summaryrefslogtreecommitdiffstats
path: root/libcxx/src
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Revert r216497: "[libcxx] Fix ctype_byname<wchar_t>::do_is() mask checking."Jonathan Roelofs2014-08-271-30/+30
| | | | | | | | | | | | | | | | After discussing implementing more tests for this with @danalbert & @mclow, I realized this change is not correct. The C++ standard requires do_is() to behave as if it were a loop that checked is(). Furthermore, it requires is() to check "The first form returns the result of the expression (M & m) != 0; i.e., true if the character has the characteristics specified"... which the reverted patch definitely does not conform to. Even further, furthermore, this requires that ctype's mask be an actual bitmask, unlike what android and newlib provide for _ctype_. Fixing the original bug that instigated this patch remains TBD. llvm-svn: 216508
* [libcxx] Fix ctype_byname<wchar_t>::do_is() mask checking.Jonathan Roelofs2014-08-261-30/+30
| | | | | | | This patch: http://reviews.llvm.org/D5081 Original patch: http://reviews.llvm.org/D5071 (from @danalbert) llvm-svn: 216497
* Revert "Turn off extern templates for most uses."Justin Bogner2014-08-155-9/+0
| | | | | | | | | | | Turning off explicit template instantiation leads to a pretty significant build time and code size cost. We're better off dealing with ABI incompatibility issues that come up in a less heavy handed way. This reverts commit r189610. llvm-svn: 215740
* Make Android's ctype_base::mask unsigned.Dan Albert2014-07-311-1/+1
| | | | | | | Keeping the regex code sane is much easier if we match the other platforms and use an unsigned mask. llvm-svn: 214442
* Base regex code on char_class_type.Dan Albert2014-07-291-3/+3
| | | | | | | | | | | | __get_classname() and __bracket_expression were assuming that char_class_type was ctype_base::mask rather than using regex_traits<_CharT>::char_class_type. This change allows char_class_type to be defined to something other than ctype_base::mask so that the implementation will still work for platforms with an 8-bit ctype mask (such as Android and OpenBSD). llvm-svn: 214201
* Fix classic_locale for Android.Dan Albert2014-07-221-1/+1
| | | | | | Android's classic_locale begins at _ctype_ + 1. llvm-svn: 213672
* Add support for BIONIC C library (Android). Patch from Dan AlbertMarshall Clow2014-07-101-2/+4
| | | | llvm-svn: 212724
* Handle partial nanosleeps in this_thread::sleep_forDavid Majnemer2014-06-041-1/+3
| | | | | | | | | | Signals may result in nanosleep returning with only some of the requested sleeping performed. Utilize nanosleep's "time-remaining" out parameter to continue sleeping when this occurs. llvm-svn: 210210
* [libc++] Don't return uninitialized data from random_device::operator()David Majnemer2014-06-031-1/+16
| | | | | | | | | | Make sure we appropriately retry calls to read if the return result is less than what we asked for. Additionally, check and handle IO errors: EINTR results in the read operation getting restarted; other errors turn into exceptions. llvm-svn: 210061
* [libc++] random_device fails if open returns zeroDavid Majnemer2014-06-031-1/+1
| | | | | | | | | | | | | random_device::random_device(const string&) wrongly assumes that open can only validly return a file descriptor greater than zero. This results in random_device believing that it didn't successfully open the device causing it to throw in it's constructor, this ends up leaking a file descriptor. The fix is simple, don't error on file descriptors which are zero. llvm-svn: 210060
* Linux: Correctly identify valid error codesDavid Majnemer2014-05-292-1/+12
| | | | | | | | | | | | | | [syserr.errcat.objects]p4 specifies that system_category().default_error_condition(ev) map to error_condition(posv, generic_category()) if ev could map to a POSIX errno. Linux reserves up to and including 4095 for errno values, use this as a bound. This fixes syserr.errcat.objects/system_category.pass.cpp on Linux. llvm-svn: 209795
* Fix typosAlp Toker2014-05-153-4/+4
| | | | llvm-svn: 208869
* Exceptions store the message as reference counted string forJoerg Sonnenberger2014-04-301-110/+14
| | | | | | | | | compatibility to libstdc++. Move the implementation into a header for easier sharing with libc++abi. Merge a number of improvements from that version. Provide a POD definition for <stdexcept>'s public use to avoid cast dances. Discussed with Marshall Clow. llvm-svn: 207695
* Implement LWG issue #2135. If something goes wrong in ↵Marshall Clow2014-03-261-2/+2
| | | | | | condition_variable::wait, call terminate() rather than throwing an error. Do this indirectly, by marking the call as 'noexcept'. This is better than just calling terminate() directly, because it gives a better error message on the console. llvm-svn: 204778
* Implement N3891: A proposal to rename shared_mutex to shared_timed_mutexDavid Majnemer2014-03-171-7/+7
| | | | | | | | | | This is as straightforward as it sounds, a renamed from shared_mutex to shared_timed_mutex. Note that libcxx .dylib and .so files built with c++14 support need to be rebuilt. llvm-svn: 204078
* Replace a tab with a spaceDavid Majnemer2014-03-171-1/+1
| | | | llvm-svn: 204077
* Adjust build fix from r199494 to use C++ castsAlp Toker2014-01-171-1/+1
| | | | | | Change suggested by Joerg Sonnenberger! llvm-svn: 199500
* Build fix for gcc builtinAlp Toker2014-01-171-1/+1
| | | | | | | | | | The __sync_add_and_fetch() builtin parameter is volatile but clang has 'different' type checking and ends up accepting this code. Undo the C++ cast from r198505 to get libc++/LLVM building with g++ while this is investigated. llvm-svn: 199494
* Add license headers to a bunch of libc++ files that were missing them. No ↵Marshall Clow2014-01-161-0/+8
| | | | | | functionality change. Fixes 18291. Thanks to Nico for the bug report and the patch. llvm-svn: 199400
* Replace casts of __impl_ with the correct reinterpret_cast of theJoerg Sonnenberger2014-01-071-16/+16
| | | | | | address. Restores the assembly of before r198504. llvm-svn: 198698
* Switch to using C++ style casts.Joerg Sonnenberger2014-01-047-76/+87
| | | | llvm-svn: 198505
* Fix GCC unknown pragma warning in libc++.Logan Chien2013-12-142-0/+17
| | | | | | | | | | We should check defined(__clang__) before the usage of the clang diagnostic pragmas. The [-Wswitch] warning in src/future.cpp should be ignored. As the result, the equivalent GCC pragma is added. llvm-svn: 197314
* Patch by Xing Xue to improve libc++ support for AIXMarshall Clow2013-11-191-1/+1
| | | | llvm-svn: 195144
* Patch by Bruce Mitchener. Change all references to EMSCRIPTEN to ↵Marshall Clow2013-11-192-15/+15
| | | | | | __EMSCRIPTEN__. If you're not using the PP symbol EMSCRIPTEN, then you should see no functionality change. llvm-svn: 195136
* G M suggestion: conditionally include files on _WIN32.Yaron Keren2013-11-181-0/+2
| | | | llvm-svn: 195045
* This patch implements snprintf_l function in a way similar to the other Yaron Keren2013-11-181-0/+10
| | | | | | | | | | | functions in src/support/win32/locale_win32.cpp and locale_win32.h, calling upon vsnprintf for which there is a MingW correct alternative. Note! __USE_MINGW_ANSI_STDIO is not modified in this patch. In order to use the __mingw version it must be defined before including the MingW headers. llvm-svn: 195044
* Move <optional> into include/experimental, and into the std::experimental ↵Marshall Clow2013-11-151-3/+3
| | | | | | namespace, since it's not part of C++14, but of an upcoming TS llvm-svn: 194867
* Patch from Bruce Mitchener; fixes two typos in comments. No functionality ↵Marshall Clow2013-11-112-2/+2
| | | | | | change. PR17843 llvm-svn: 194432
* Patch from GM: locale.cpp; make implicit conversions to bool explicit, fix ↵Marshall Clow2013-10-211-3/+21
| | | | | | some 'unknown pragma' warnings when compiling under MSVC, and don't use the __sso_allocator under windows, b/c MSVC doesn't support aligned-by value parameters llvm-svn: 193086
* Patch from GM to make more implicit bools explicit since we can't stop MSVC ↵Marshall Clow2013-10-131-4/+4
| | | | | | warning about this in headers and to warn is the MSVC default. No functionality change. llvm-svn: 192548
* LWG Issue 2087: iostream_category() and noexceptMarshall Clow2013-10-121-1/+1
| | | | llvm-svn: 192545
* LWG issue 2143: ios_base::xalloc should be thread-safeMarshall Clow2013-10-121-1/+4
| | | | llvm-svn: 192539
* patch by Yaron: Uses rand_s() from stdlib.h (when building for Windows)Marshall Clow2013-10-091-0/+26
| | | | llvm-svn: 192325
* Silence the unused function warning in exception.cpp.Peter Collingbourne2013-10-061-17/+16
| | | | | | | Rather than try to protect the function behind a precise, ever-changing #if expression, just inline it into every caller. llvm-svn: 192077
* Implement std::exception_ptr under libsupc++.Peter Collingbourne2013-10-061-12/+51
| | | | | | | | | | | | | | | | | libsupc++ does not implement the dependent EH ABI and the functionality it uses to implement std::exception_ptr (which it declares as an alias of std::__exception_ptr::exception_ptr) is not directly exported to clients. So we have little choice but to hijack std::__exception_ptr::exception_ptr's (which fortunately has the same layout as our std::exception_ptr) copy constructor, assignment operator and destructor (which are part of its stable ABI), and its rethrow_exception(std::__exception_ptr::exception_ptr) function. Also, remove some out of date comments. Differential Revision: http://llvm-reviews.chandlerc.com/D1826 llvm-svn: 192076
* Make it possible to link against libstdc++ as well as libsupc++ with CMake.Peter Collingbourne2013-10-062-2/+6
| | | | | | | | | | | | | | | Linking against libstdc++, rather than libsupc++, is probably better for people who need to link against clients of libstdc++. Because libsupc++ is provided only as a static library, its globals are not shared between the static library and the copy linked into libstdc++. This has been found to cause at least one test failure. This also removes a number of symbols which were multiply defined between libstdc++ and libc++, only when linking with libstdc++. Differential Revision: http://llvm-reviews.chandlerc.com/D1825 llvm-svn: 192075
* Eliminate more symbols multiply defined between libsupc++ and libc++.Peter Collingbourne2013-10-062-1/+19
| | | | | | | | | | | | | | | The remaining multiple definitions were flushed out by attempting to link libsupc++ and libc++ into the same executable with --whole-archive, e.g. clang++ -I../llvm/projects/libcxx/include -nodefaultlibs -Wl,--whole-archive lib/libc++.a /usr/lib/gcc/x86_64-linux-gnu/4.6/libsupc++.a -Wl,--no-whole-archive -lgcc -lgcc_s -lc -lpthread -lrt (The same technique was used to flush out multiple definitions in libstdc++.) Differential Revision: http://llvm-reviews.chandlerc.com/D1824 llvm-svn: 192074
* Use _LIBCPP_NEW_DELETE_VIS instead of LIBCPP_FUNC_VIS in src/new.cpp.Howard Hinnant2013-10-061-8/+8
| | | | llvm-svn: 192071
* G M: The attached patch is for libcxx's new.cpp and __config files. The ↵Howard Hinnant2013-10-041-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | patch's intent is to make new.cpp compile using MS's cl.exe compiler without changing the meaning of anything for any other compiler. The issue this patch seeks to address is that MS's compiler (cl.exe) doesn't support the __attribute__((__weak__)) or __atribute__((__visibility__("default")) syntax; so a solution must be found where cl.exe doesn't see this syntax. This patch seeks to solve this problem by changing code patterned like this: __attribute__((__weak__, __visibility__("default"))) void* operator new(size_t size, const std::nothrow_t&) _NOEXCEPT { /*snip*/; return p; } to code like this: _LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) _NOEXCEPT { return p; } Howard: Thanks for all the comments regarding the default visibility tag on the definition. I agree it isn't needed, and that there are lots of other places where it is missing. That being said, I'm not wanting to rock the boat on that issue right now. So I've added it back to the definition via _LIBCPP_FUNC_VIS. A later pass dedicated just to this issue can bring things in to a consistent state one way or the other. Note that we do not want to have the exact same attributes on the declaration and defintion in this case. The declaration should not be marked weak, whereas the definition should (which is what G M's patch did). I've fully tested on OS X to ensure that the resultant attribute syntax actually works. llvm-svn: 192007
* G M: A small patch to fix a couple of warnings in stdexcept.cpp for cl.exe ↵Howard Hinnant2013-10-041-0/+4
| | | | | | which does not support #pragma visibility. llvm-svn: 191988
OpenPOWER on IntegriCloud