summaryrefslogtreecommitdiffstats
path: root/libcxx/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Threading support: externalize sleep_for() function.Asiri Rathnayake2017-02-091-2/+35
| | | | | | | | | | Different platforms implement the wait/sleep functions in difrerent ways. It makes sense to externalize this into the threading API. Differential revision: https://reviews.llvm.org/D29630 Reviewers: EricWF, joerg llvm-svn: 294573
* Add missing include in <numeric>Eric Fiselier2017-02-081-0/+1
| | | | llvm-svn: 294393
* Prevent UBSAN from generating unsigned overflow diagnostics in the hashing ↵Eric Fiselier2017-02-081-10/+23
| | | | | | internals llvm-svn: 294391
* Refer to _LIBCPP_MSVC macro where applicableSaleem Abdulrasool2017-02-064-5/+5
| | | | | | | | | Replace preprocess conditions of defined(_MSC_VER) && !defined(__clang__) with defined(_LIBCPP_MSVC). NFC. Patch by Dave Lee! llvm-svn: 294171
* Implement LWG 2773 - std::ignore should be constexpr.Eric Fiselier2017-02-061-3/+5
| | | | | | | | In addition to the PR for LWG 2773 this patch also ensures that each of std::ignores constructors or assignment operators are constexpr. llvm-svn: 294165
* Restore the _NOEXCEPT on the dtor of bad_optional_access. Destructors are ↵Marshall Clow2017-02-052-2/+2
| | | | | | noexcept by default, so it's not really needed, but the other exception classes have the _NOEXCEPT, and gcc complains if these are missing. I think we should remove them all - but not today. llvm-svn: 294142
* Fix variant build errors with GCC 7Eric Fiselier2017-02-051-2/+1
| | | | llvm-svn: 294141
* Change the base class of std::bad_optional_access. This is a (subtle) ABI ↵Marshall Clow2017-02-052-6/+4
| | | | | | change, and is in response to http://http://wg21.link/LWG2806, which I *expect* to be adopted in Kona. I am making this change now in anticipation, and will get it into 4.0, because (a) 4.0 is the first release with std::optional, and (b) I don't want to make an ABI-change later, when the user base should be significantly larger. Note that I didn't change std::experimental::bad_optional_access, because that's still specified to derive from std::logic_error. llvm-svn: 294133
* Recommit [libcxx] Never use <cassert> within libc++Eric Fiselier2017-02-042-1/+2
| | | | | | | | | | It is my opinion that libc++ should never use `<cassert>`, including in the `dylib`. This patch remove all uses of `assert` from within libc++ and replaces most of them with `_LIBCPP_ASSERT` instead. Additionally this patch turn `LIBCXX_ENABLE_ASSERTIONS` off by default, because the standard library should not be aborting user programs unless explicitly asked to. llvm-svn: 294107
* Fix inconsistency in tuple's SFINAE. Patch from Andrey Khalyavin"Eric Fiselier2017-02-041-1/+1
| | | | llvm-svn: 294106
* Mark basic_string::assign templates as inline to improve ABI stability.Eric Fiselier2017-02-041-2/+2
| | | | | | | | | | | | Visible definitions for basic_string::assign are sometimes emitted in the dylib depending on the version of LLVM used to compile libc++. This can cause the check-cxx-abilist target to fail. This patch attempts marks the basic_string::assign templates as inline to prevent this. That way the export list is consistent across LLVM versions. llvm-svn: 294100
* Undefine min/max in __treeEric Fiselier2017-02-041-0/+2
| | | | llvm-svn: 294099
* Fix PR#31779: basic_string::operator= isn't exception safe.Marshall Clow2017-01-311-4/+20
| | | | llvm-svn: 293599
* Revert "Adorn __call_once_proxy with `inline` and `_LIBCPP_INLINE_VISIBILITY`"Justin Bogner2017-01-311-1/+0
| | | | | | | | | | | | | | | While this change didn't really hurt, it does lead to spurious warnings about not being able to override weak symbols if you end up linking objects built with this change to ones built without it. Furthermore, since __call_once_proxy is called indirectly anyway it doesn't actually inline ever. Longer term, it would probably make sense to give this symbol internal visibility instead. This reverts r291497 llvm-svn: 293581
* experimental: remove some extraneous _LIBCPP_FUNC_VISSaleem Abdulrasool2017-01-301-14/+13
| | | | | | | | | | These member functions were decorated with `_LIBCPP_FUNC_VIS` when the class is also decorated with external visibility. This breaks down when building for PE/COFF, where the member function cannot be decorated if it is within a decorated class. The class attribute will propagate to the member. Remove the extraneous decoration. llvm-svn: 293454
* experimental: tolerate the existence of a `__deref` macroSaleem Abdulrasool2017-01-301-6/+9
| | | | | | | | Microsoft's SAL has a `__deref` macro which results in a compilation failure when building the filesystem module on Windows. Rename the member function internally to avoid the conflict. llvm-svn: 293449
* config: prevent the re-definition of a macroSaleem Abdulrasool2017-01-291-0/+2
| | | | | | | | | This causes unnecessary warnings when building with `cl`. Newer versions of the C standard permit the redefinition of the macro to the same value (which is the case here), unfortunately, `cl` does not yet implement this. Add a check to prevent the redefinition. llvm-svn: 293439
* Disable thread safety analysis for some functions in __thread_supportDimitry Andric2017-01-261-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many thread-related libc++ test cases fail on FreeBSD, due to the following -Werror warnings: In file included from test/std/thread/thread.threads/thread.thread.this/sleep_until.pass.cpp:17: In file included from include/thread:97: In file included from include/__mutex_base:17: include/__threading_support:222:1: error: mutex '__m' is still held at the end of function [-Werror,-Wthread-safety-analysis] } ^ include/__threading_support:221:10: note: mutex acquired here return pthread_mutex_lock(__m); ^ include/__threading_support:231:10: error: releasing mutex '__m' that was not held [-Werror,-Wthread-safety-analysis] return pthread_mutex_unlock(__m); ^ include/__threading_support:242:1: error: mutex '__m' is still held at the end of function [-Werror,-Wthread-safety-analysis] } ^ include/__threading_support:241:10: note: mutex acquired here return pthread_mutex_lock(__m); ^ include/__threading_support:251:10: error: releasing mutex '__m' that was not held [-Werror,-Wthread-safety-analysis] return pthread_mutex_unlock(__m); ^ include/__threading_support:272:10: error: calling function 'pthread_cond_wait' requires holding mutex '__m' exclusively [-Werror,-Wthread-safety-analysis] return pthread_cond_wait(__cv, __m); ^ include/__threading_support:278:10: error: calling function 'pthread_cond_timedwait' requires holding mutex '__m' exclusively [-Werror,-Wthread-safety-analysis] return pthread_cond_timedwait(__cv, __m, __ts); ^ 6 errors generated. This is because on FreeBSD, the pthread functions have lock annotations. Since the functions in __thread_support are internal to libc++ only, add no_thread_safety_analysis attributes to suppress these warnings. Reviewers: mclow.lists, EricWF, delesley, aaron.ballman Reviewed By: aaron.ballman Subscribers: ed, aaron.ballman, joerg, emaste, cfe-commits Differential Revision: https://reviews.llvm.org/D28520 llvm-svn: 293197
* Fix chromium build (libcxx)Asiri Rathnayake2017-01-261-11/+0
| | | | | | Remove the reference to pthread_mach_thread_np() in libcxx headers. llvm-svn: 293167
* Use the new __has_feature(cxx_constexpr_string_builtins) for detection of ↵Marshall Clow2017-01-262-14/+7
| | | | | | the C-string intrinsics for constexpr support in std::char_traits. Thanks to Richard for the intrisic support. llvm-svn: 293154
* Fixed a typo in the synopsis (noecept -> noexcept). Thanks to Kim for the catchMarshall Clow2017-01-251-1/+1
| | | | llvm-svn: 293079
* Implement LWG2556: Wide contract for future::share()Marshall Clow2017-01-241-9/+9
| | | | llvm-svn: 292992
* Change the return type of emplace_[front|back] back to void when building ↵Marshall Clow2017-01-246-11/+89
| | | | | | with C++14 or before. Resolves PR31680. llvm-svn: 292990
* Remove auto_ptr in C++17. Get it back by defining ↵Marshall Clow2017-01-241-6/+23
| | | | | | _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR llvm-svn: 292986
* Implement LWG2733: [fund.ts.v2] gcd / lcm and bool. We already did tbis for ↵Marshall Clow2017-01-241-0/+4
| | | | | | C++17, so replicate the changes in experimental. llvm-svn: 292962
* Revert "[libcxx] Never use <cassert> within libc++"Eric Fiselier2017-01-242-2/+1
| | | | | | | | This reverts commit r292883. Unfortunately <string_view> uses _LIBCPP_ASSERT in a way which is not compatible with the C++11 dylib build. I'll investigate more tomorrow. llvm-svn: 292923
* [libcxx] Never use <cassert> within libc++Eric Fiselier2017-01-242-1/+2
| | | | | | | | | | | | | | | | | Summary: It is my opinion that libc++ should never use `<cassert>`, including in the `dylib`. This patch remove all uses of `assert` from within libc++ and replaces most of them with `_LIBCPP_ASSERT` instead. Additionally this patch turn `LIBCXX_ENABLE_ASSERTIONS` off by default, because the standard library should not be aborting user programs unless explicitly asked to. Reviewers: mclow.lists, compnerd, smeenai Reviewed By: mclow.lists Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D29063 llvm-svn: 292883
* Manually force the use of __decltype in C++03 with Clang 3.4.Eric Fiselier2017-01-231-1/+8
| | | | | | | | | | | | | <string> uses `decltype` in a way incompatible with `__typeof__`. This is problematic when compiling <string> with Clang 3.4 because even though it provides `__decltype` libc++ still used `__typeof__` because clang 3.4 doesn't provide __is_identifier which libc++ uses to detect __decltype. This patch manually detects Clang 3.4 and properly configures for it. llvm-svn: 292833
* Fix GCC C++03 build by hiding default template argument in C++03Eric Fiselier2017-01-231-0/+3
| | | | llvm-svn: 292830
* Implement LWG#2778: basic_string_view is missing constexpr.Marshall Clow2017-01-231-5/+5
| | | | llvm-svn: 292823
* Fixed a typo in __config that prevented the aligned new/delete tests from ↵Marshall Clow2017-01-231-1/+1
| | | | | | passing on Mac OS. llvm-svn: 292822
* Revert accidentally changes which reverted r292582Eric Fiselier2017-01-211-1/+1
| | | | llvm-svn: 292717
* Implement P0513R0 - "Poisoning the Hash"Eric Fiselier2017-01-217-605/+657
| | | | | | | | | | | | | | | | | | | | | Summary: Exactly what the title says. This patch also adds a `std::hash<nullptr_t>` specialization in C++17, but it was not added by this paper and I can't find the actual paper that adds it. See http://wg21.link/P0513R0 for more info. If there are no comments in the next couple of days I'll commit this Reviewers: mclow.lists, K-ballo, EricWF Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28938 llvm-svn: 292684
* Still expose std::align_val_t in C++17 even if we don't have aligned new/delete.Eric Fiselier2017-01-201-1/+1
| | | | | | | | | | | r292564 disabled the aligned new/delete overloads on platforms without posix_memalign. Unfortunately that patch also disabled the align_val_t definition in C++17 as well. This patch causes align_val_t to be exposed in C++17 regardless of if we have the new/delete overloads. llvm-svn: 292582
* Disable aligned new/delete on Apple platforms without posix_memalignEric Fiselier2017-01-202-2/+15
| | | | | | | | | | | | | | | | | | | Summary: This patch disables the aligned new/delet overloads on Apple platforms without `posix_memalign`. This fixes libc++.dylib build regressions on such platforms. This fixes http://llvm.org/PR31448. This patch should also be merged into the 4.0 release branch Reviewers: mclow.lists, rsmith, dexonsmith, jeremyhu Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28931 llvm-svn: 292564
* Adjust msvc_stdlib_force_include.hpp to handle clang++Eric Fiselier2017-01-191-1/+3
| | | | | | | | | | | | Summary: This patch adjusts the newly added `msvc_stdlib_force_include.hpp` so that it also works when used with `clang++`. Reviewers: STL_MSFT Reviewed By: STL_MSFT Differential Revision: https://reviews.llvm.org/D28917 llvm-svn: 292539
* Fix filesystem::path assignment from {}Eric Fiselier2017-01-181-0/+1
| | | | | | | | Adding `path::operator=(string_type&&)` made the expression `p = {}` ambiguous. This path fixes that ambiguity by making the `string&&` overload a template so it ranks lower during overload resolution. llvm-svn: 292345
* Fix type_info's constructor by making it explicit again.Eric Fiselier2017-01-171-2/+3
| | | | | | | In recent changes type_info's private constructor was accidentally made implicit. This patch fixes that. llvm-svn: 292294
* Fix std::string assignment ambiguity from braced initializer lists.Eric Fiselier2017-01-171-0/+1
| | | | | | | | | | When support for `basic_string_view` was added to string it also added new assignment operators from `basic_string_view`. These caused ambiguity when assigning from a braced initializer. This patch fixes that regression by making the basic_string_view assignment operator rank lower in overload resolution by making it a template. llvm-svn: 292276
* Add ABI option to remove recently inlined __shared_count functions from the ↵Eric Fiselier2017-01-173-5/+8
| | | | | | | | | | | | | | library. In order to allow inlining of previously out-of-line functions without an ABI break libc++ provides legacy definitions in the dylib that old programs can continue to use. Unfortunatly Windows link.exe detects this hack and diagnoses the duplicate definitions. This patch disable the duplicate definitions on Windows by adding an ABI option which disables all "legacy out-of-line symbols" llvm-svn: 292190
* Fix DLL build by removing _LIBCPP_FUNC_VIS from member of class marked dllexportEric Fiselier2017-01-171-5/+5
| | | | llvm-svn: 292185
* [Test patch] Inline hot functions in libcxx shared_ptrKevin Hu2017-01-171-5/+69
| | | | | | | | | | | Moves hot functions such as atomic add into the memory header file so that they can be inlined, which brings performance benefits. Patch by Kevin Hu, Aditya Kumar, Sebastian Pop Differential Revision: https://reviews.llvm.org/D24991 llvm-svn: 292184
* Fix std::tuples EBO when targeting the MSVC ABI.Eric Fiselier2017-01-162-1/+11
| | | | | | | | | | | MSVC/clang-cl doesn't do a full EBO unless __declspec(empty_bases) is applied to the derived type. This causes certain tuple tests to fail. This patch adds the empty_bases attribute to __tuple_impl in order for tuple to fully provide the EBO. llvm-svn: 292159
* [libc++] Introduce _LIBCPP_EXTERN_VIS to fix __libcpp_debug_function link errorsEric Fiselier2017-01-162-1/+6
| | | | | | | | | | | | | | Summary: On Windows tests that use `_LIBCPP_ASSERT` fail to link because the assertion handler function isn't correctly exported from the libc++ dylib. This patch fixes the dll import/export issues by introducing a new visibility macro `_LIBCPP_EXTERN_VIS` for use on external variables. Reviewers: compnerd, smeenai, EricWF Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28728 llvm-svn: 292158
* [libcxx] Don't assume __libcpp_thread_t is an integral typeAsiri Rathnayake2017-01-162-5/+20
| | | | | | | | | | | | | We have already refactored the underlying platform thread type into __libcpp_thread_t, but there are few places in the source where we still assume it is an integral type. This patch refactores those points back into the threading API. Differential revision: https://reviews.llvm.org/D28608 Reviewers: EricWF llvm-svn: 292107
* Added a workaround for a `-fdelayed-template-parsing` bug.Michael Park2017-01-161-8/+13
| | | | | | | | | | | | | | | Summary: There seems to be an additional bug in `-fdelayed-template-parsing` similar to http://llvm.org/viewvc/llvm-project?view=revision&revision=236063. This is a workaround for it for <variant> to compile with `clang-cl` on Windows. Reviewers: EricWF Differential Revision: https://reviews.llvm.org/D28734 llvm-svn: 292097
* Implement the missing constexpr stuff in <array>. Fixes PR#31645.Marshall Clow2017-01-161-5/+9
| | | | llvm-svn: 292091
* Attempt two at fixing threading on WindowsEric Fiselier2017-01-141-9/+6
| | | | | | | | | | Reviewers: compnerd Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28735 llvm-svn: 292027
* Fix thread creation on WindowsEric Fiselier2017-01-141-13/+19
| | | | llvm-svn: 292022
* Fix Windows try_lock implementationEric Fiselier2017-01-141-12/+10
| | | | llvm-svn: 292011
OpenPOWER on IntegriCloud