summaryrefslogtreecommitdiffstats
path: root/libcxx/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement P0966 - string::reserve should not shrinkMarshall Clow2018-11-281-1/+3
| | | | llvm-svn: 347789
* Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`. Eric Fiselier2018-11-286-35/+45
| | | | | | | | | | | | | | | | | | | | | Summary: Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See llvm.org/PR39713 This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used. This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement. I think we should commit this change immediately, and decide what we want to do about the ABI afterwards. Reviewers: ldionne, EricWF Reviewed By: EricWF Subscribers: christof, libcxx-commits Differential Revision: https://reviews.llvm.org/D54814 llvm-svn: 347787
* [libcxx] Remove dynarrayLouis Dionne2018-11-284-312/+0
| | | | | | | | | | | | | | Summary: std::dynarray had been proposed for C++14, but it was pulled out from C++14 and there are no plans to standardize it anymore. Reviewers: mclow.lists, EricWF Subscribers: mgorny, christof, jkorous, dexonsmith, arphaman, libcxx-commits Differential Revision: https://reviews.llvm.org/D54801 llvm-svn: 347783
* [libcxx] Apply _LIBCPP_INLINE_VISIBILITY for std::hash for string_viewLouis Dionne2018-11-281-9/+4
| | | | llvm-svn: 347765
* Implement P1085R2 - Should Span be Regular?. This consists entirely of deletionsMarshall Clow2018-11-271-44/+0
| | | | llvm-svn: 347672
* Remove duplicate _LIBCPP_INLINE_VISIBILITY attributes.Eric Fiselier2018-11-261-60/+60
| | | | | | | This attribute should appear only on the first declaration. This patch cleans up <string> by removing the attribute on redeclarations. llvm-svn: 347608
* Add basic_string::__resize_default_init (from P1072)Eric Fiselier2018-11-261-0/+34
| | | | | | | | | | | This patch adds an implementation of __resize_default_init as described in P1072R2. Additionally, it uses it in filesystem to demonstrate its intended utility. Once P1072 lands, or if it changes it's interface, I will adjust the internal libc++ implementation to match. llvm-svn: 347589
* [libcxx] Remove unused definition of aligned allocation macro on old OS XLouis Dionne2018-11-211-5/+0
| | | | | | | | We don't support mac OS 10.6 and older anymore, so this macro can never be defined. This bit of code had been added in D28931 as a fix for PR31448, but it doesn't seem necessary anymore. llvm-svn: 347427
* [libcxx] Make sure operator+ is declared with the right visibility attributeLouis Dionne2018-11-211-0/+1
| | | | | | | Otherwise, Clang complains about internal_linkage not being applied to the first declaration of the operator (and rightfully so). llvm-svn: 347400
* [libcxx] Mark stray symbols as hidden to try and fix the buildLouis Dionne2018-11-212-3/+3
| | | | | | | | | | | | r347395 changed the ABI list on Linux, but two of those symbols are still being exported from the shared object: _ZSt18make_exception_ptrINSt3__112future_errorEESt13exception_ptrT_ _ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_PKS6_ This commit makes sure those symbols are not exported, as they should be. llvm-svn: 347399
* [libcxx] Make sure we can build with -fvisibility=hidden on LinuxLouis Dionne2018-11-213-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit marks a few functions as hidden and removes them from the ABI list on Linux such that libc++ can be built with -fvisibility=hidden. The functions marked as hidden by this patch were exported from the shared object only because they were implicitly instantiated function templates. It is safe to stop exporting those symbols from the shared object because nobody could actually depend on them: implicit instantiations are not taken from shared objects. The symbols removed in this commit are basically the same that had been removed in https://reviews.llvm.org/D53868, but that patch had to be reverted because it broke the build (because the functions were not marked as hidden like this patch does). Reviewers: EricWF, mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D54639 llvm-svn: 347395
* [libc++] Implement P0487R1 - Fixing operator>>(basic_istream&, CharT*)Zhihao Yuan2018-11-211-8/+49
| | | | | | | | | | | | | | | | | | | Summary: Avoid buffer overflow by replacing the pointer interface with an array reference interface in C++2a. Tentatively ready on Batavia2018. https://wg21.link/lwg2499 https://wg21.link/p0487 Reviewers: mclow.lists, ldionne, EricWF Reviewed By: ldionne Subscribers: libcxx-commits, cfe-commits, christof Differential Revision: https://reviews.llvm.org/D51268 llvm-svn: 347377
* [NFC] Reformat availability #defines in __configLouis Dionne2018-11-201-8/+5
| | | | | | Aligning everything makes what we're doing more obvious. llvm-svn: 347363
* [libcxx] Fix threads detection on GNU/HurdLouis Dionne2018-11-201-0/+1
| | | | | | | | | GNU/Hurd provides standard Posix threads Reviewed as https://reviews.llvm.org/D54339. Thanks to Samuel Thibault for the patch. llvm-svn: 347347
* [libcxx] Add availability markup for bad_optional_access, bad_variant_access ↵Louis Dionne2018-11-194-5/+39
| | | | | | | | | | | | and bad_any_cast Reviewers: dexonsmith, EricWF Subscribers: christof, arphaman, libcxx-commits Differential Revision: https://reviews.llvm.org/D53256 llvm-svn: 347219
* Implement P0972R0: <chrono> zero(), min(), and max() should be noexcept. ↵Marshall Clow2018-11-131-16/+16
| | | | | | Reviewed as https://reviews.llvm.org/D53828 llvm-svn: 346766
* [libcxx] Implement http://wg21.link/p1006, constexpr in pointer_traitsLouis Dionne2018-11-131-2/+2
| | | | | | | | | | | | | | | | Summary: P1006 adds support for constexpr in the specialization of pointer_traits for raw pointers. This is necessary in order to use pointer_traits in the upcoming constexpr containers. We expect P1006 to be voted into the working draft for C++20 at the San Diego meeting. Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D53867 llvm-svn: 346764
* Fix PR39619 - iterator_traits isn't SFINAE-friendly enough. Thanks to Eric ↵Marshall Clow2018-11-131-1/+18
| | | | | | for the report llvm-svn: 346738
* [NFC] Fix typo in <tuple>Louis Dionne2018-11-121-1/+1
| | | | llvm-svn: 346629
* [libcxx] Provide thread annotations for shared_mutexPetr Hosek2018-11-091-7/+8
| | | | | | | | | | shared_mutex was introduced in C++17 but its implementation currently doesn't use Clang's thread annotations like regular mutex. This change adds those. Differential Revision: https://reviews.llvm.org/D54290 llvm-svn: 346567
* Fix -Wimplicit-fallthrough warningFangrui Song2018-11-071-0/+2
| | | | | | | | | | | | Reviewers: EricWF, ldionne, mclow.lists Reviewed By: ldionne Subscribers: christof, libcxx-commits Differential Revision: https://reviews.llvm.org/D54234 llvm-svn: 346369
* [NFC] Fix incorrect comment in std::listLouis Dionne2018-11-031-1/+1
| | | | llvm-svn: 346072
* Revert "Bug 39129: Speeding up partition_point/lower_bound/upper_bound/ by ↵Louis Dionne2018-11-011-30/+4
| | | | | | | | | | | using unsigned division by 2 when possible." This reverts r345525. I'm reverting because that patch apparently caused a regression on certain platforms (see https://reviews.llvm.org/D53994). Since we don't fully understand the reasons for the regression, I'm reverting until we can provide a fix we understand. llvm-svn: 345893
* Use C++11 fallthrough attribute syntax when available and add a breakReid Kleckner2018-11-011-1/+5
| | | | | | | | | | | | | | | | | | | Summary: This silences the two -Wimplicit-fallthrough warnings clang finds in ItaniumDemangle.h in libc++abi. Clang does not have a GNU attribute spelling for this attribute, so this is necessary. I will commit the same change to the LLVM demangler soon. Reviewers: EricWF, ldionne Subscribers: christof, erik.pilkington, cfe-commits Differential Revision: https://reviews.llvm.org/D53985 llvm-svn: 345870
* [libcxx] Fix usage of _C2, which is a "nasty macro" in some environmentsLouis Dionne2018-11-012-36/+36
| | | | | | The problem was pointed out in https://reviews.llvm.org/D48896#inline-475775. llvm-svn: 345834
* Second half of C++17's splicing maps and setsErik Pilkington2018-10-318-68/+642
| | | | | | | | | | This commit adds a merge member function to all the map and set containers, which splices nodes from the source container. This completes support for P0083r3. Differential revision: https://reviews.llvm.org/D48896 llvm-svn: 345744
* Make libc++'s versioning namespace customizableEric Fiselier2018-10-302-3/+6
| | | | | | | | | | | | | | | | | Summary: This patch makes the versioning namespace libc++ uses customizable by the user using `-DLIBCXX_ABI_NAMESPACE=__foo`. This allows users to build custom versions of libc++ which can be linked into binaries with other libc++ versions without causing symbol conflicts or ODR issues. Reviewers: mclow.lists, ldionne Reviewed By: ldionne Subscribers: kristina, smeenai, mgorny, phosek, libcxx-commits Differential Revision: https://reviews.llvm.org/D53879 llvm-svn: 345657
* Unify definition of _LIBCPP_BEGIN/END_NAMESPACE_STDEric Fiselier2018-10-301-35/+19
| | | | llvm-svn: 345561
* Bug 39129: Speeding up partition_point/lower_bound/upper_bound/ by using ↵Eric Fiselier2018-10-291-4/+30
| | | | | | | | | | | | unsigned division by 2 when possible. Patch by Denis Yaroshevskiy (denis.yaroshevskij@gmail.com) The rational and measurements can be found in the bug description: https://bugs.llvm.org/show_bug.cgi?id=39129 Reviewed as https://reviews.llvm.org/D52697 llvm-svn: 345525
* [libc++] Use exclude_from_explicit_instantiation instead of always_inlineLouis Dionne2018-10-291-1/+10
| | | | | | | | | | | | | | | | | | | | | | | Summary: This commit adopts the exclude_from_explicit_instantiation attribute discussed at [1] and reviewed in [2] in libc++ to supplant the use of __always_inline__ for visibility purposes. This change means that users wanting to link together translation units built with different versions of libc++'s headers into the same final linked image MUST define the _LIBCPP_HIDE_FROM_ABI_PER_TU macro to 1 when building those TUs. Doing otherwise will lead to ODR violations and ABI issues. [1]: http://lists.llvm.org/pipermail/cfe-dev/2018-August/059024.html [2]: https://reviews.llvm.org/D51789 Reviewers: rsmith, EricWF Subscribers: dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D52405 llvm-svn: 345516
* Fix PR39458 _LIBCPP_DEBUG breaks heterogeneous compare.Eric Fiselier2018-10-261-12/+0
| | | | | | | | | | | | | | | | | | | | The types/comparators passed to std::upper_bound and std::lower_bound are not required to provided to provide an operator</comp(...) which accepts the arguments in reverse order. Nor are the ranges required to have a strict weak ordering. However, in debug mode we attempted to check the result of a comparison with the arguments reversed, which may not compiler. This patch removes the use of the debug comparator for upper_bound and lower_bound. equal_range et al still use debug comparators when they call __upper_bound and __lower_bound. See llvm.org/PR39458 llvm-svn: 345434
* Fix incorrect use of aligned allocation in get_temporary_buffer.Eric Fiselier2018-10-261-1/+1
| | | | llvm-svn: 345403
* Run the min/max tests agaist the header <charconv>. Fix that header so it ↵Marshall Clow2018-10-261-0/+5
| | | | | | passes. NFC. llvm-svn: 345352
* fix incorrect placement of _LIBCPP_ALWAYS_INLINE in valarrayEric Fiselier2018-10-251-1/+2
| | | | llvm-svn: 345289
* Implement sized deallocation for std::allocator and friends.Eric Fiselier2018-10-255-56/+133
| | | | | | | | | | | | | | | | | | | Summary: C++14 sized deallocation is disabled by default due to ABI concerns. However, when a user manually enables it then libc++ should take advantage of it since sized deallocation can provide a significant performance win depending on the underlying malloc implementation. (Note that libc++'s definitions of sized delete don't do anything special yet, but users are free to provide their own). This patch updates __libcpp_deallocate to selectively call sized operator delete when it's available. `__libcpp_deallocate_unsized` should be used when the size of the allocation is unknown. On Apple this patch makes no attempt to determine if the sized operator delete is unavailable, only that the language feature is enabled. This could cause a compile error when using `std::allocator`, but the same compile error would occur whenever the user calls `new`, so I don't think it's a problem. Reviewers: ldionne, mclow.lists Reviewed By: ldionne Subscribers: rsmith, ckennelly, libcxx-commits, christof Differential Revision: https://reviews.llvm.org/D53120 llvm-svn: 345281
* [libc++] Make sure we can build libc++ with -fvisibility=hiddenLouis Dionne2018-10-259-21/+42
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: When building with -fvisibility=hidden, some symbols do not get exported from libc++.dylib. This means that some entities are not explicitly given default visibility in the source code, and that we rely on the fact -fvisibility=default is the default. This commit explicitly gives default visibility to those symbols to avoid being dependent on the command line flags used. The commit also remove symbols from the dylib -- those symbols do not actually need to be exported from the dylib and this should not be an ABI break. Finally, in the future, we may want to mark the whole std:: namespace as having hidden visibility (to switch from opt-out to opt-in), in which case the changes done in this commit will be required. Reviewers: EricWF Subscribers: mgorny, christof, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D52662 llvm-svn: 345260
* Revert "Fix use of __libcpp_deallocate in dynarray"Eric Christopher2018-10-251-1/+1
| | | | | | This reverts commit r345234 as it depended on the sized deallocation commit. llvm-svn: 345240
* Temporarily Revert "Implement sized deallocation for std::allocator and ↵Eric Christopher2018-10-254-130/+53
| | | | | | | | | | friends." This is breaking the bots here (and related): http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-asan/builds/1428 This reverts commit r345214. llvm-svn: 345239
* Fix use of __libcpp_deallocate in dynarrayEric Fiselier2018-10-251-1/+1
| | | | llvm-svn: 345234
* Implement sized deallocation for std::allocator and friends.Eric Fiselier2018-10-244-53/+130
| | | | | | | | | | | | | | | | | | | Summary: C++14 sized deallocation is disabled by default due to ABI concerns. However, when a user manually enables it then libc++ should take advantage of it since sized deallocation can provide a significant performance win depending on the underlying malloc implementation. (Note that libc++'s definitions of sized delete don't do anything special yet, but users are free to provide their own). This patch updates __libcpp_deallocate to selectively call sized operator delete when it's available. `__libcpp_deallocate_unsized` should be used when the size of the allocation is unknown. On Apple this patch makes no attempt to determine if the sized operator delete is unavailable, only that the language feature is enabled. This could cause a compile error when using `std::allocator`, but the same compile error would occur whenever the user calls `new`, so I don't think it's a problem. Reviewers: ldionne, mclow.lists Reviewed By: ldionne Subscribers: rsmith, ckennelly, libcxx-commits, christof Differential Revision: https://reviews.llvm.org/D53120 llvm-svn: 345214
* Revert "Teach __libcpp_is_floating_point that __fp16 and _Float16 are"Petr Hosek2018-10-241-6/+0
| | | | | | | | | This reverts commits r333103 and r333108. _Float16 and __fp16 are C11 extensions and compilers other than Clang don't define these for C++. Differential Revision: https://reviews.llvm.org/D53670 llvm-svn: 345199
* Off-by-one errors strike again. Thank goodness for ASAN and the bots.Marshall Clow2018-10-231-4/+14
| | | | llvm-svn: 345076
* When filling a vector<bool> with stuff, initialize the last word of the ↵Marshall Clow2018-10-231-0/+4
| | | | | | storage that you're touching. Otherwise, when we lay down the bits with operator&=, we get UB from reading uninitialized memory. Fixes Bug 39354. Thanks to David Wagner for the bug report. llvm-svn: 345067
* Update commnents to reflect the changes for LWG#3127. NFCMarshall Clow2018-10-221-1/+1
| | | | llvm-svn: 344953
* Update commnents to reflect the changes for LWG#3122. NFCMarshall Clow2018-10-221-0/+1
| | | | llvm-svn: 344950
* [libcxx] Avoid repeating the definition of std:: namespacesLouis Dionne2018-10-161-20/+6
| | | | | | This reduces code duplication a tiny bit. llvm-svn: 344642
* [libcxx] Remove _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITYLouis Dionne2018-10-165-41/+40
| | | | | | | | | | | | That macro has been defined to _LIBCPP_HIDE_FROM_ABI_AFTER_V1 for many weeks now, so we're actually replacing uses of it for uses of _LIBCPP_HIDE_FROM_ABI_AFTER_V1 directly. This should not change or break anything since the two macros are 100% equivalent, unless somebody is (incorrectly!) relying on _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY being defined. llvm-svn: 344641
* Recommit <chrono> changes with a couple xtra tests marked to fail on apple's ↵Marshall Clow2018-10-162-1/+1037
| | | | | | clang. Reviewed as D51762 llvm-svn: 344627
* Partial fix for PR38964. (<string> can't be built with gcc -std=c++03) ↵Marshall Clow2018-10-161-0/+10
| | | | | | Reviewed as https://reviews.llvm.org/D52240 llvm-svn: 344616
* Revert r344529 "Implement the first part of the calendar support for C++20"Artem Dergachev2018-10-162-1037/+1
| | | | | | | | | | Revert r344535 "Wrap up the new chrono literals in an #ifdef..." Revert r344546 "Mark a couple of test cases as 'C++17-only'..." Some of the buildbot failures were masked by another error, and this one was probably missed. llvm-svn: 344580
OpenPOWER on IntegriCloud