summaryrefslogtreecommitdiffstats
path: root/libcxx/src
Commit message (Collapse)AuthorAgeFilesLines
* Mark any as done and comment out extra methods until speaking to MarshallEric Fiselier2015-07-311-3/+3
| | | | llvm-svn: 243729
* [libcxx] Add <experimental/any> v2.Eric Fiselier2015-07-311-0/+22
| | | | | | | | | | | | | | | | Summary: This patch adds the second revision of <experimental/any>. I've been working from the LFTS draft found at this link. https://rawgit.com/cplusplus/fundamentals-ts/v1/fundamentals-ts.html#any Reviewers: danalbert, jroelofs, K-ballo, mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6762 llvm-svn: 243728
* [libcxx] Add atomic_support.h header to src that handles needed atomic ↵Eric Fiselier2015-07-073-10/+159
| | | | | | | | | | | | | | | | | | | | | operations. Summary: In some places in libc++ we need to use the `__atomic_*` builtins. This patch adds a header that provides access to those builtins in a uniform way from within the dylib source. If the compiler building the dylib does not support these builtins then a warning is issued. Only relaxed loads are needed within the headers. A singe function to do these relaxed loads has been added to `<memory>`. This patch applies the new atomic builtins to `__shared_count` and `call_once`. Reviewers: mclow.lists Subscribers: majnemer, jroelofs, cfe-commits Differential Revision: http://reviews.llvm.org/D10406 llvm-svn: 241532
* Make locale code compile on CloudABI.Ed Schouten2015-07-061-10/+13
| | | | | | | | | | | | | | | | | | | After r241454 landed, libc++'s locale code compiles on CloudABI, with the exception of the following two bits: - CloudABI doesn't have setlocale(), as the C library does not keep track of any global state. The global locale is always set to "C". Disable the call to setlocale() on this system. - Similarly, mbtowc_l() is also not present, as it is also not thread-safe. As CloudABI does not support state-dependent encodings, simply disable that part of the logic. The locale code now compiles out of the box on CloudABI. Differential Revision: http://reviews.llvm.org/D10729 Reviewed by: jroelofs llvm-svn: 241455
* Cleanup: prefer _LIBCPP_GET_C_LOCALE over __cloc().Ed Schouten2015-07-061-11/+11
| | | | | | | | | | | | | The __cloc() function is only present in case the environment does not provide a way to refer to the C locale using a compile-time constant expression. _LIBCPP_GET_C_LOCALE seems to be defined unconditionally. This improves compilation of the locale code on CloudABI. Differential Revision: http://reviews.llvm.org/D10690 Reviewed by: jroelofs llvm-svn: 241454
* Implement N4508: shared_mutex. Reviewed as http://reviews.llvm.org/D10480Marshall Clow2015-06-301-7/+18
| | | | llvm-svn: 241067
* When building libc++, we use '"' as a delimiter instead of '<' when ↵Marshall Clow2015-06-232-4/+4
| | | | | | including libc++ header files. This is so that the dylib gets built with our headers; rather than the system-installed ones. We do this in most places already, just fixing a couple of inconsistent uses. llvm-svn: 240412
* Fix PR23293 - Do not unlock shared state before notifying consumers.Eric Fiselier2015-06-121-5/+0
| | | | | | | | Within the shared state methods do not unlock the lock guards manually. This could cause a race condition where the shared state is destroyed before the method is complete. llvm-svn: 239577
* Avoid C-style cast.Joerg Sonnenberger2015-06-051-1/+1
| | | | llvm-svn: 239160
* Move uncaught_exeption() definition inside the #ifdef block like ↵Marshall Clow2015-06-021-1/+1
| | | | | | uncaught_exceptions() llvm-svn: 238879
* Implement uncaught_exceptions() using the newly added hooks in libc++abi, ↵Marshall Clow2015-06-021-5/+11
| | | | | | when available llvm-svn: 238846
* Fix building and testing libc++ with GCC.Eric Fiselier2015-05-201-1/+1
| | | | | | | | | | | | | | | | The changes in src/exception.cpp and cmake/Modules/HandleLibCXXABI.cmake fix a bug when building libc++ with GCC. Because GCC does not support __has_include we need to explicitly tell it that we are building against libc++abi via the preprocessor definition `LIBCXX_BUILDING_LIBCXXABI`. The changes in include/ratio are to work around CWG defect 1712 (constexpr variable template declarations). GCC 4.8 and before has not adopted the resolution to this defect. The changes in include/exception work around an issue where is_final is used without it being defined in type_traits. llvm-svn: 237767
* Fix for LWG Issue 2458: N3778 and new library deallocation signatures.Marshall Clow2015-05-181-14/+0
| | | | llvm-svn: 237592
* Use clock_gettime()'s CLOCK_REALTIME instead of gettimeofday().Ed Schouten2015-05-141-24/+40
| | | | | | | | | | | | | | | | | | | | | The system_clock::now() function currently uses gettimeofday(). The problem with gettimeofday() is that it is an obsolete XSI function, hence unavailable on CloudABI. See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/gettimeofday.html Change this code to use clock_gettime() with CLOCK_REALTIME instead, which is more consistent, as clock_gettime() is already used for steady_clock. A previous version of this change actually attempted to change system_clock::duration, but I reverted this part as it breaks the existing ABI. Differential Revision: http://reviews.llvm.org/D8253 Approved by: jroelofs llvm-svn: 237390
* Fix -Wpessimizing-move warning by remove the call to std::move.Richard Trieu2015-04-301-1/+1
| | | | llvm-svn: 236265
* Make the presence of stdin and stdout optional.Ed Schouten2015-03-261-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea behind Nuxi CloudABI is that it is targeted at (but not limited to) running networked services in a sandboxed environment. The model behind stdin, stdout and stderr is strongly focused on interactive tools in a command shell. CloudABI does not support the notion of stdin and stdout, as 'standard input/output' does not apply to services. The concept of stderr does makes sense though, as services do need some mechanism to log error messages in a uniform way. This patch extends libc++ in such a way that std::cin and std::cout and the associated <cstdio>/<cwchar> functions can be disabled through the flags _LIBCPP_HAS_NO_STDIN and _LIBCPP_HAS_NO_STDOUT, respectively. At the same time it attempts to clean up src/iostream.cpp a bit. Instead of using a single array of mbstate_t objects and hardcoding the array indices, it creates separate objects that declared next to the iostream objects and their buffers. The code is also restructured by interleaving the construction and setup of c* and wc* objects. That way it is more obvious that this is done identically. The c* and wc* objects already have separate unit tests. Make use of this fact by adding XFAILs in case libcpp-has-no-std* is set. That way the tests work in both directions. If stdin or stdout is disabled, these tests will therefore test for the absence of c* and wc*. Differential Revision: http://reviews.llvm.org/D8340 llvm-svn: 233275
* Remove the state_types array.Ed Schouten2015-03-261-8/+12
| | | | | | | | | | | | | | | If we want to add support for making std::cin and std::cout optional, it is impractical to have all of the mbstate_t objects in one array. This would mean that if std::cin and std::cout are omitted, the state_types array is only used partially. Solve this by using separate global variables. These are placed right next to the iostream object and the buffer, meaning we can easily #ifdef them away. Differential Revision: http://reviews.llvm.org/D8359 llvm-svn: 233274
* Fix incorrect error handling of call to mbrtowc. This is PR#13759. Leaving ↵Marshall Clow2015-03-231-1/+1
| | | | | | the bug open because (1) I'm not sure that we're correct here, only better than before, and (2) no tests llvm-svn: 233012
* Fix use after free and calls to operator comma in debug modeEric Fiselier2015-03-191-1/+1
| | | | llvm-svn: 232703
* Clean up iostream creation in preparation for conditionalizing streams.Ed Schouten2015-03-171-18/+20
| | | | | | | | | | | | Interleave the code for narrow and wide character streams. This makes it more obvious that the two pieces of code are identical. Furthermore, it makes it easier to conditionally compile support for certain streams, as less #ifdef blocks are needed. Differential Revision: http://reviews.llvm.org/D8342 Reviewed by: marshall llvm-svn: 232516
* Fix build break on Solaris introduced by r231940Jonathan Roelofs2015-03-131-0/+2
| | | | | | | | | Solaris apparently doesn't have iswblank_l. Thanks to C Bergstrom for the report! llvm-svn: 232172
* Fix ctype_byname<wchar_t>::do_is() mask checking.... againJonathan Roelofs2015-03-111-30/+38
| | | | | | | | | This basically reverts the revert in r216508, and fixes a few more cases while I'm at it. Reading my commit message on that commit again, I think it's bupkis. http://reviews.llvm.org/D8237 llvm-svn: 231940
* Move Android to the builtin rune table.Dan Albert2015-03-111-2/+0
| | | | llvm-svn: 231897
* Don't include <sys/sysctl.h> on CloudABI.Ed Schouten2015-03-101-2/+2
| | | | | | | As CloudABI does not provide sysctl(), this header is not present. Make thread.cpp build correctly (and pass all tests) by not including the header. llvm-svn: 231768
* Print log/error messages on stderr, not stdoutEd Schouten2015-03-102-9/+9
| | | | | | | | | | | | There are a couple of places where libc++ prints log/error messages to stdout on its own. This may of course interfere with the output generated with applications. Log/error messages should be directed to stderr instead. Differential Revision: http://reviews.llvm.org/D8135 Reviewed by: marshall llvm-svn: 231767
* Add support for arc4random() to random_device.Ed Schouten2015-03-101-35/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | Nuxi CloudABI (https://github.com/NuxiNL/cloudlibc) does not allow processes to access the global filesystem namespace. This breaks random_device, as it attempts to use /dev/{u,}random. This change adds support for arc4random(), which is present on CloudABI. In my opinion it would also make sense to use arc4random() on other operating systems, such as *BSD and Mac OS X, but I'd rather leave that to the maintainers of the respective platforms. Switching to arc4random() does change the ABI. This change also attempts to make some cleanups to the code. It adds a single #define for every random interface, instead of testing against operating systems explicitly. As discussed, also validate the token argument to be equal to "/dev/urandom" on all systems that only provide pseudo-random numbers. This should cause little to no breakage, as "/dev/urandom" is also the default argument value. Reviewed by: jfb Differential Revision: http://reviews.llvm.org/D8134 llvm-svn: 231764
* Nbjoerg suggested a better name for the macro for the default rune table: ↵Marshall Clow2015-03-041-1/+1
| | | | | | _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE llvm-svn: 231255
* Create a default rune table for libc++. Initial setting - never enabled. The ↵Marshall Clow2015-03-041-0/+82
| | | | | | expectation is that some targets (Android, cough) will enable it. Note that this is an implementation detail, not an interface change. llvm-svn: 231252
* libc++: support newlib's ctypeJF Bastien2015-02-251-0/+3
| | | | | | | | | | | | Summary: Newlib supports ctype differently from other platforms, this patch teaches libc++ about yet another platform that does ctype differently. Reviewers: jroelofs Subscribers: cfe-commits, danalbert, EricWF, jvoung, jfb, mclow.lists Differential Revision: http://reviews.llvm.org/D7888 llvm-svn: 230557
* Reword ELAST warningJF Bastien2015-02-241-1/+1
| | | | | | | | | | | | | | | | Summary: GCC emits a pretty amusing warning when there are apostrophes in a #warning: ```warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]``` Reword the warning to avoid this, and be more consistent with other warnings in libc++. Reviewers: danalbert Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7818 llvm-svn: 230298
* More on adding sized deallocation functions in libc++: Continuing from ↵Larisse Voufo2015-02-201-8/+8
| | | | | | r229281, this adds version guards and test cases. llvm-svn: 229968
* Implement C++14's sized deallocation functions, since there are no longer ↵Larisse Voufo2015-02-151-1/+29
| | | | | | implicitly defined by clang, as of r229241. llvm-svn: 229281
* libc++: remove unused variable in random_device::operator()()JF Bastien2015-02-041-1/+0
| | | | | | | | | | Reviewers: jvoung Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7416 llvm-svn: 228183
* Get libc++ building on Sun Solaris. Patch from C Bergstrom.Eric Fiselier2015-01-231-200/+13
| | | | llvm-svn: 226947
* [libcxx] Set _LIBCPP_ELAST for mingw.Dan Albert2015-01-063-7/+50
| | | | | | | | | | | | Reviewers: K-ballo, mclow.lists, EricWF Reviewed By: EricWF Subscribers: jfb, jroelofs, majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D6558 llvm-svn: 225273
* Fix building and running tests when LIBCXX_ENABLE_EXCEPTIONS or ↵Eric Fiselier2014-12-121-1/+1
| | | | | | LIBCXX_ENABLE_RTTI are turned off. llvm-svn: 224095
* Add all the relational operators to std::experimental::optional. Also update ↵Marshall Clow2014-12-091-3/+2
| | | | | | bad_optional_access to match the Library Fundamentals draft standard. This is not all of the upcoming changes to optional, though. llvm-svn: 223775
* libc++: support NaCl when building thread.cppJF Bastien2014-12-021-4/+4
| | | | | | | | | | | | | | Summary: NaCl shouldn't include sysctl.h when trying to determine std::thread::hardware_concurrency, it should instead use sysconf(_SC_NPROCESSORS_ONLN) through unistd.h. No test needs to be changed, since hardware_concurrency.pass.cpp already tests that std::thread::hardware_concurrency > 0. Test Plan: make check-libcxx Reviewers: dschuff, danalbert Subscribers: jfb, cfe-commits Differential Revision: http://reviews.llvm.org/D6470 llvm-svn: 223128
* libc++: add NaCl and PNaCl support for std::random_deviceJF Bastien2014-12-011-6/+43
| | | | | | | | | | | | | | | | | Summary: The NaCl sandbox doesn't allow opening files under /dev, but it offers an API which provides the same capabilities. This is the same random device emulation that nacl_io performs for POSIX support, but nacl_io is an optional library so libc++ can't assume that device emulation will be performed. Note that NaCl only supports /dev/urandom, not /dev/random. This patch also cleans up some of the preprocessor #endif, and fixes the test for Win32 (it accepts any token, and would therefore never throw regardless of the token provided). Test Plan: ninja check-libcxx Reviewers: dschuff, mclow.lists, danalbert Subscribers: jfb, cfe-commits Differential Revision: http://reviews.llvm.org/D6442 llvm-svn: 223068
* Fixes to get libc++ building on sun solaris. Patch from C Bergstrom.Eric Fiselier2014-11-251-1/+1
| | | | llvm-svn: 222794
* Initialize pointer in string conversion helpers to prevent MSAN diagnostic.Eric Fiselier2014-11-141-2/+2
| | | | | | | | Since the initialization of the pointer happens across the libc library boundry MSAN will not know the pointer was initialized. This fixes MSAN failures in test/strings/string.conversions. llvm-svn: 222052
* Partial fix for building w/ libcxxrt on OSX. Patch from C Bergstrom.Eric Fiselier2014-11-012-2/+2
| | | | llvm-svn: 221029
* libcxxrt defines bad_array_new_length::what() so move that into a ↵Eric Fiselier2014-11-011-6/+6
| | | | | | conditional compilation block llvm-svn: 221025
* libcxxrt now implements bad_array_new_length and need to gaurd against ↵Eric Fiselier2014-10-291-2/+2
| | | | | | multiple defines. Patch from Baptiste Daroussin. llvm-svn: 220882
* PR #21321 talked about implementation-defined behavior of realloc. I ↵Marshall Clow2014-10-271-28/+22
| | | | | | poo-poohed it, and was wrong. Fix the call in <locale>. Review the others, refactored some duplicated code, and found overflow bugs (and __event_cap_ was never getting updated, either). llvm-svn: 220702
* Address some post-commit review comments on r217261Jonathan Roelofs2014-09-052-2/+2
| | | | llvm-svn: 217276
* Allow libc++ to be built on systems without POSIX threadsJonathan Roelofs2014-09-059-3/+102
| | | | | | | | | | If you're crazy enough to want this sort of thing, then add -D_LIBCPP_HAS_NO_THREADS to your CXXFLAGS and --param=additiona_features=libcpp-has-no-threads to your lit commnad line. http://reviews.llvm.org/D3969 llvm-svn: 217271
* Fix comment that was obsoleted by r216949Jonathan Roelofs2014-09-021-4/+2
| | | | llvm-svn: 216999
* Partially address a FIXME in steady_clock::now()Jonathan Roelofs2014-09-021-0/+3
| | | | | | http://reviews.llvm.org/D4045 llvm-svn: 216949
* Newlib names ELAST differently than linuxJonathan Roelofs2014-09-022-23/+14
| | | | llvm-svn: 216943
OpenPOWER on IntegriCloud