summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
...
* Refactor the newly created <bit> header. Still (almost) NFC. Reviewed as ↵Marshall Clow2018-08-172-83/+72
| | | | | | https://reviews.llvm.org/D50876 llvm-svn: 340049
* Recommit r339943 - Establish the <bit> header. NFC yet. Reviewed as ↵Marshall Clow2018-08-175-136/+176
| | | | | | https://reviews.llvm.org/D50815 - with a fix for the sanitizer bots llvm-svn: 340045
* Revert "Establish the <bit> header. NFC yet. Reviewed as ↵Vitaly Buka2018-08-164-175/+136
| | | | | | | | | | https://reviews.llvm.org/D50815" Breaks build on sanitizer bots. This reverts commit r339943. llvm-svn: 339971
* [libc++] Use correct rand.eng.mers all-zeroes seed sequence fallbackHubert Tong2018-08-162-2/+83
| | | | | | | | | | | | | | | | | | | | | | | Summary: When a seed sequence would lead to having no non-zero significant bits in the initial state of a `mersenne_twister_engine`, the fallback is to flip the most significant bit of the first value that appears in the textual representation of the initial state. rand.eng.mers describes this as setting the value to be 2 to the power of one less than w; the previous value encoded in the implementation, namely one less than "2 to the power of w", is replaced by the correct value in this patch. Reviewers: mclow.lists, EricWF, jasonliu Reviewed By: mclow.lists Subscribers: mclow.lists, jasonliu, EricWF, christof, ldionne, cfe-commits Differential Revision: https://reviews.llvm.org/D50736 llvm-svn: 339969
* Establish the <bit> header. NFC yet. Reviewed as https://reviews.llvm.org/D50815Marshall Clow2018-08-164-136/+175
| | | | llvm-svn: 339943
* [libcxx] By default, do not use internal_linkage to hide symbols from the ABILouis Dionne2018-08-166-5/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: https://reviews.llvm.org/D49240 led to symbol size problems in Chromium, and we expect this may be the case in other projects built in debug mode too. Instead, unless users explicitly ask for internal_linkage, we use always_inline like we used to. In the future, when we have a solution that allows us to drop always_inline without falling back on internal_linkage, we can replace always_inline by that. Note that this commit introduces a change in contract for existing libc++ users: by default, libc++ used to guarantee that TUs built with different versions of libc++ could be linked together. With the introduction of the _LIBCPP_HIDE_FROM_ABI_PER_TU macro, the default behavior is that TUs built with different libc++ versions are not guaranteed to link. This is a change in contract but not a change in behavior, since the current implementation still allows linking TUs built with different libc++ versions together. Reviewers: EricWF, mclow.lists, dexonsmith, hans, rnk Subscribers: christof, cfe-commits Differential Revision: https://reviews.llvm.org/D50652 llvm-svn: 339874
* Selectively import timespec_get into namespace std, since some C libraries ↵Marshall Clow2018-08-156-5/+15
| | | | | | don't have it. Reviewed as https://reviews.llvm.org/D50799 llvm-svn: 339816
* Mark the at_exit and at_quick_exit tests as unsupported under C++98 an 03, ↵Marshall Clow2018-08-153-2/+3
| | | | | | since those calls were introduced in C++11. They're already guarded by an ifdef in the code, so this is a 'belt-and-suspenders' change. llvm-svn: 339804
* libcxx: Mark __temp_value::__temp_value as _LIBCPP_NO_CFI.Peter Collingbourne2018-08-151-2/+5
| | | | | | | | | | | | | | This constructor needs to cast a pointer to uninitialized memory to a pointer to object type in order to call allocator_traits::construct(). This cast is not allowed when CFI cast checks are enabled. I did this instead of marking __addr() as _LIBCPP_NO_CFI so that we don't lose CFI checks on get() or the dtor. Differential Revision: https://reviews.llvm.org/D50743 llvm-svn: 339797
* For FreeBSD, don't define _M in nasty_macros.hppDimitry Andric2018-08-151-0/+4
| | | | | | | | | | Because FreeBSD uses _M in its <sys/types.h>, and it is hard to avoid including that header, only define _M to NASTY_MACRO for other operating systems. This fixes almost 2000 unexpected test failures. Discussed with Eric Fiselier. llvm-svn: 339794
* [libcxx] Fix XFAILs for aligned allocation tests on older OSX versionsLouis Dionne2018-08-1516-102/+193
| | | | | | | | | | | | | | | | | Summary: Since r338934, Clang emits an error when aligned allocation functions are used in conjunction with a system libc++ dylib that does not support those functions. This causes some tests to fail when testing against older libc++ dylibs. This commit marks those tests as UNSUPPORTED, and also documents the various reasons for the tests being unsupported. Reviewers: vsapsai, EricWF Subscribers: christof, dexonsmith, cfe-commits, mclow.lists, EricWF Differential Revision: https://reviews.llvm.org/D50341 llvm-svn: 339743
* [libc++] Disable failing C11 feature tests for <cfloat> and <float.h>Louis Dionne2018-08-152-6/+6
| | | | | | | | | | | | | | Summary: Those tests are breaking the test bots. A Bugzilla has been filed to make sure those tests are re-enabled: https://bugs.llvm.org/show_bug.cgi?id=38572 Reviewers: mclow.lists, EricWF Subscribers: krytarowski, christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50748 llvm-svn: 339742
* [libc++] Detect C11 features on non-Clang compilersLouis Dionne2018-08-151-22/+22
| | | | | | | | | | | | | | | Summary: The macros were inside `#if defined(_LIBCPP_COMPILER_CLANG)`, which means we would never detect C11 features on non-Clang compilers. According to Marshall Clow, this is not the intended behavior. Reviewers: mclow.lists, EricWF Subscribers: krytarowski, christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50748 llvm-svn: 339741
* [libc++] Fix incorrect definition of TEST_HAS_C11_FEATURESLouis Dionne2018-08-141-1/+1
| | | | | | | | | | | | | | Summary: The macro was not defined in C++11 mode when it should have been, at least according to how _LIBCPP_HAS_C11_FEATURES is defined. Reviewers: mclow.lists, EricWF, jfb, dexonsmith Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50719 llvm-svn: 339702
* [CMake] Fix the LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY optionMartin Storsjo2018-08-141-1/+1
| | | | | | | | | | | This option should be available if LIBCXX_ENABLE_SHARED is enabled, not LIBCXX_ENABLE_STATIC. This fixes a typo from SVN r337814. Differential Revision: https://reviews.llvm.org/D50691 llvm-svn: 339697
* [libc++] Add missing #include in C11 features testsLouis Dionne2018-08-143-0/+7
| | | | | | | | | | | | | | | | | | Summary: These #includes are quite important, since otherwise any #if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) checks are always false, and so we don't actually test for C11 support in the standard library. Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50674 llvm-svn: 339675
* [libcxx] Mark charconv tests as failing for previous libcxx versions.Volodymyr Sapsai2018-08-102-0/+18
| | | | | | | | | | | | | | | <charconv> was added in r338479. Previous libcxx versions don't have this functionality and corresponding tests should be failing. Reviewers: mclow.lists, ldionne, EricWF Reviewed By: ldionne Subscribers: christof, dexonsmith, lichray, EricWF, cfe-commits Differential Revision: https://reviews.llvm.org/D50543 llvm-svn: 339451
* [libc++] Enable aligned allocation based on feature test macro, irrespective ↵Louis Dionne2018-08-103-7/+30
| | | | | | | | | | | | | | | | | | | | | of standard Summary: The current code enables aligned allocation functions when compiling in C++17 and later. This is a problem because aligned allocation functions might not be supported on the target platform, which leads to an error at link time. Since r338934, Clang knows not to define __cpp_aligned_new when it's not available on the target platform -- this commit takes advantage of that to only use aligned allocation functions when they are available. Reviewers: vsapsai, EricWF Subscribers: christof, dexonsmith, cfe-commits, EricWF, mclow.lists Differential Revision: https://reviews.llvm.org/D50344 llvm-svn: 339431
* [libcxx] [test] Avoid -Wunused-local-typedef in node_handle.pass.cpp.Billy Robert O'Neal III2018-08-081-1/+3
| | | | llvm-svn: 339218
* [libcxx] [test] Allow a standard library that implements LWG 1203 in ↵Billy Robert O'Neal III2018-08-081-1/+1
| | | | | | | | istream.rvalue/rvalue.pass.cpp (Still pending review at https://reviews.llvm.org/D47400 which has been open since may; will ask for forgiveness rather than permission :) ) llvm-svn: 339214
* [libcxx] [test] Remove nonportable locale assumption in ↵Billy Robert O'Neal III2018-08-081-3/+3
| | | | | | | | | | basic.ios.members/narrow.pass.cpp I'm not sure if libcxx is asserting UTF-8 here; but on Windows the full char value is always passed through in its entirety, since the default codepage is something like Windows-1252. The replacement character is only used for non-chars there; and that should be a more portable test everywhere. (Still pending review at https://reviews.llvm.org/D47395 which has been open since may; will ask for forgiveness rather than permission :) ) llvm-svn: 339213
* [libcxx] [test] Remove asserts that <cstddef> and <stdexcept> are included ↵Billy Robert O'Neal III2018-08-081-10/+1
| | | | | | | | by <bitset> Reviewed as https://reviews.llvm.org/D50421 llvm-svn: 339212
* [libcxx] [test] Add missing <stdexcept> in several tests.Billy Robert O'Neal III2018-08-0817-0/+17
| | | | | | Reviewed as https://reviews.llvm.org/D50420 llvm-svn: 339209
* [libc++] Add the _LIBCPP_HIDE_FROM_ABI_AFTER_V1 macroLouis Dionne2018-08-063-105/+25
| | | | | | | | | | | | | | | | | | | | | Summary: This macro allows hiding symbols from the ABI when the library is built with an ABI version after ABI v1, which is currently the only stable ABI. This commit defines `_LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY` to be `_LIBCPP_HIDE_FROM_ABI_AFTER_V1`, meaning that symbols that were only exported by the library for historical reasons are not exported anymore in the unstable ABI. Because of that, this commit is an ABI break for ABI v2. This ABI version is not stable, however, so this should not be a problem. Reviewers: EricWF, mclow.lists Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D49914 llvm-svn: 339012
* Mark LWG#2260 as complete. We already did the right thing, so I just added ↵Marshall Clow2018-08-033-2/+4
| | | | | | tests to ensure that we continue to DTRT. llvm-svn: 338936
* [NFC][libc++] Consistently use spaces to indentLouis Dionne2018-08-0312-79/+79
| | | | | | rdar://problem/19988944 llvm-svn: 338933
* Make my new test harness work w/c++03Marshall Clow2018-08-031-2/+2
| | | | llvm-svn: 338803
* Update the changes to the array tests (that I committed yesterday) to use ↵Marshall Clow2018-08-031-55/+8
| | | | | | the test_comparison routines that I committed last week. NFC. llvm-svn: 338797
* Implement P1023: constexpr comparison operators for std::arrayMarshall Clow2018-08-023-10/+56
| | | | llvm-svn: 338668
* Implement P0887: The identity metafunctionMarshall Clow2018-08-022-0/+50
| | | | llvm-svn: 338666
* Update version to 8.0.0svn: cmake, includes files and docsHans Wennborg2018-08-014-6/+6
| | | | llvm-svn: 338555
* [libc++] Fix GCC 7.2.0 macro redefinition warningLouis Dionne2018-08-011-1/+1
| | | | | | | | | | The warning happens when LIBCXX_ENABLE_EXCEPTIONS cmake option is not set, and it fires every time __config is included, 33 in total. Patch by Jason Lovett Reviewed as https://reviews.llvm.org/D49997 llvm-svn: 338531
* [libc++] Fix build failures after merging <charconv>Zhihao Yuan2018-08-013-1/+4
| | | | | | | | | | | | | | Summary: - fix a stupid unit test typo - add <charconv> symbols to Linux abilist Reviewers: EricWF Subscribers: christof, ldionne, cfe-commits Differential Revision: https://reviews.llvm.org/D50130 llvm-svn: 338486
* [libc++][C++17] Elementary string conversions for integral typesZhihao Yuan2018-08-0110-0/+1402
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Major QoI considerations: - The facility is backported to C++14, same as libstdc++. - Efforts have been made to minimize the header dependencies. - The design is friendly to the uses of MSVC intrinsics (`__emulu`, `_umul128`, `_BitScanForward`, `_BitScanForward64`) but not implemented; future contributions are welcome. Thanks to Milo Yip for contributing the implementation of `__u64toa` and `__u32toa`. References: https://wg21.link/p0067r5 https://wg21.link/p0682r1 Reviewers: mclow.lists, EricWF Reviewed By: mclow.lists Subscribers: ldionne, Quuxplusone, christof, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D41458 llvm-svn: 338479
* [libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since ↵Louis Dionne2018-08-0115-21/+13
| | | | | | | | | | | | | | _LIBCPP_BUILDING_LIBRARY Summary: As suggested by Marshall in https://reviews.llvm.org/D49914 Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50008 llvm-svn: 338475
* First half of C++17's splicing maps and setsErik Pilkington2018-08-0143-9/+3214
| | | | | | | | | | | | | This commit adds a node handle type, (located in __node_handle), and adds extract() and insert() members to all map and set types, as well as their implementations in __tree and __hash_table. The second half of this feature is adding merge() members, which splice nodes in bulk from one container into another. This will be committed in a follow-up. Differential revision: https://reviews.llvm.org/D46845 llvm-svn: 338472
* Final bit of P0063 - make sure that aligned_alloc is available when the ↵Marshall Clow2018-07-313-4/+24
| | | | | | underlying C library supports it llvm-svn: 338457
* Test for the presence of a bunch of new macros for c++17. These macros come ↵Marshall Clow2018-07-314-0/+105
| | | | | | from C11. Part of P0063 llvm-svn: 338454
* import timespec and timespec_get into namespace std if we're under c++17 or ↵Marshall Clow2018-07-313-3/+41
| | | | | | later AND the underlying C library has them. Fixes PR#38220, but doesn't implement all of P0063 yet. llvm-svn: 338419
* Introduce a new test macro TEST_HAS_C11_FEATURES which is set when the ↵Marshall Clow2018-07-312-10/+66
| | | | | | underlying C library has C11 features. In C++17, we use those features. <__config> defines a similar macro, _LIBCPP_HAS_C11_FEATURES, but we don't want to use that in the library-independent parts of the tests, so define the new one. Also add a libc++-specific test to make sure the two stay in sync. llvm-svn: 338411
* Code cleanup - change naked 'throw' expressions to call helpre function ↵Marshall Clow2018-07-301-33/+11
| | | | | | '__throw_future_error'. The behavior change is that if you build libc++ with exceptions disabled, and then use that in a program that sets the value of the future twice (for example), it will now abort instead of behaving unpredictably. llvm-svn: 338332
* [libcxx] fix `>> 42` UB in <experimental/simd>Tim Shen2018-07-301-1/+1
| | | | llvm-svn: 338325
* Re-apply "[libcxx] implement <simd> ABI for Clang/GCC vector extension, ↵Tim Shen2018-07-3018-445/+1481
| | | | | | | | constructors, copy_from and copy_to." ...with proper guarding #ifdefs for unsupported C++11. llvm-svn: 338318
* Revert "[libcxx] implement <simd> ABI for Clang/GCC vector extension, ↵Tim Shen2018-07-3018-1477/+445
| | | | | | | | constructors, copy_from and copy_to." This reverts commit r338309. llvm-svn: 338316
* [libcxx] implement <simd> ABI for Clang/GCC vector extension, constructors, ↵Tim Shen2018-07-3018-445/+1477
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | copy_from and copy_to. Summary: This patch adds a new macro _LIBCPP_HAS_NO_VECTOR_EXTENSION for detecting whether a vector extension (\_\_attribute\_\_((vector_size(num_bytes)))) is available. On the top of that, this patch implements the following API: * all constructors * operator[] * copy_from * copy_to It also defines simd_abi::native to use vector extension, if available. In GCC and Clang, certain values with vector extension are passed by registers, instead of memory. Based on D41148. Reviewers: mclow.lists, EricWF Subscribers: cfe-commits, MaskRay, lichray, sanjoy Differential Revision: https://reviews.llvm.org/D41376 llvm-svn: 338309
* [libc++] Exclude posix_l/strtonum fallback inclusion for newlib > 2.4Jordan Rupprecht2018-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: [libc++] Exclude posix_l/strtonum fallback inclusion for newlib > 2.4 r338122 changed the linkage of some methods which revealed an existing ODR violation, e.g.: projects/libcxx/include/support/xlocale/__posix_l_fallback.h:83:38: error: 'internal_linkage' attribute does not appear on the first declaration of 'iswcntrl_l' inline _LIBCPP_INLINE_VISIBILITY int iswcntrl_l(wint_t c, locale_t) { ^ lib/include/wctype.h:55:12: note: previous definition is here extern int iswcntrl_l (wint_t, locale_t); These were added to newlib in 2.4 [1] [2], so move them to the already existing include guard. [1] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=238455adfab4f8070ac65400aac22bb8a9e502fc [2] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=8493c1631643fada62384768408852bc0fa6ff44 Reviewers: ldionne, rsmith, EricWF Subscribers: christof, cfe-commits Differential Revision: https://reviews.llvm.org/D49927 llvm-svn: 338157
* [libc++] Introduce _LIBCPP_HIDE_FROM_ABI to replace _LIBCPP_INLINE_VISIBILITYLouis Dionne2018-07-272-9/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit introduces a new macro, _LIBCPP_HIDE_FROM_ABI, whose goal is to mark functions that shouldn't be part of libc++'s ABI. It marks the functions as being hidden for dylib visibility purposes, and as having internal linkage using Clang's __attribute__((internal_linkage)) when available, and __always_inline__ otherwise. It replaces _LIBCPP_INLINE_VISIBILITY, which was always using __always_inline__ to achieve similar goals, but suffered from debuggability and code size problems. The full proposal, along with more background information, can be found here: http://lists.llvm.org/pipermail/cfe-dev/2018-July/058419.html This commit does not rename uses of _LIBCPP_INLINE_VISIBILITY to _LIBCPP_HIDE_FROM_ABI: this wide reaching but mechanical change can be done later when we've confirmed we're happy with the new macro. In the future, it would be nice if we could optionally allow dropping any internal_linkage or __always_inline__ attribute, which could result in code size improvements. However, this is currently impossible for reasons explained here: http://lists.llvm.org/pipermail/cfe-dev/2018-July/058450.html Reviewers: EricWF, dexonsmith, mclow.lists Subscribers: christof, dexonsmith, llvm-commits, mclow.lists Differential Revision: https://reviews.llvm.org/D49240 llvm-svn: 338122
* Move Filesystem namespace definition out of a clang specific ifdef block.Eric Fiselier2018-07-271-13/+14
| | | | llvm-svn: 338103
* Add libc++fs to the test deps, and not to the target 'cxx'.Eric Fiselier2018-07-272-8/+7
| | | | llvm-svn: 338096
* Attempt to unbreak *all the bots*Eric Fiselier2018-07-274-7/+10
| | | | | | | | The bots were failing to build the cxx_filesystem target, so the tests were failing. Though this does lead me to wonder how it was ever working with c++experimental. llvm-svn: 338095
OpenPOWER on IntegriCloud