summaryrefslogtreecommitdiffstats
path: root/libcxx/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Change the ABI version and ABI namespace to be `_LIBCPP_VERSION`Eric Fiselier2019-06-251-5/+12
| | | | | | | | | | | | | when _LIBCPP_ABI_UNSTABLE is defined. User defined _LIBCPP_ABI_NAMESPACE will still be respected, but the default version namespace in unstable mode will be the libc++ version (Currently '__9000'). Previously `_LIBCPP_ABI_VERSION` and `_LIBCPP_ABI_NAMESPACE` were `1` and `__1` respectively, whuch conflicted with the stable ABI llvm-svn: 364354
* Use C++11 implementation of unique_ptr in C++03.Eric Fiselier2019-06-231-157/+51
| | | | llvm-svn: 364161
* Apply new meta-programming traits throughout the library.Eric Fiselier2019-06-237-226/+156
| | | | | | The new meta-programming primitives are lower cost than the old versions. This patch removes those old versions and switches libc++ to use the new ones. llvm-svn: 364160
* Add super fast _IsSame trait for internal use.Eric Fiselier2019-06-231-11/+20
| | | | | | | | | Clang provides __is_same that doesn't produce any instantiations and just returns a bool. It's a lot faster than using std::is_same I'll follow up with a patch to actually start using it. llvm-svn: 364148
* Add noexcept throughout <atomic>Eric Fiselier2019-06-231-28/+28
| | | | | | | | | | | The CMake CheckLibcxxAtomic module was always failing to compile the example, even when libatomic wasn't needed. This was caused because the check doesn't link a C++ runtime library to provide std::terminate, which is required for exception support. The check is still really broken, but <atomic> is better! llvm-svn: 364146
* Add new style meta-programming primatives.Eric Fiselier2019-06-211-28/+87
| | | | | | | | | | | | | Using class templates instead of alias templates causes a lot of instantiations. As part of the move away from C++03, we want to improve the efficiency of our meta-programming. This patch lays the groundwork by introducing new _If, _EnableIf, _And, _Or, and _IsValidExpansion (detect member). Future patches will replace the existing implementations after verifying there compile time differences. llvm-svn: 364114
* Implement P0340R3: Make 'underlying_type' SFINAE-friendly. Reviewed as ↵Marshall Clow2019-06-211-1/+9
| | | | | | https://reviews.llvm.org/D63574 llvm-svn: 364094
* Use rvalue references throughout the is_constructible traits.Eric Fiselier2019-06-211-147/+3
| | | | llvm-svn: 364065
* Make move and forward work in C++03.Eric Fiselier2019-06-215-93/+10
| | | | | | | | | | | | | | | | | | | | | These functions are key to allowing the use of rvalues and variadics in C++03 mode. Everything works the same as in C++11, except for one tangentially related case: struct T { T(T &&) = default; }; In C++11, T has a deleted copy constructor. But in C++03 Clang gives it both a move and a copy constructor. This seems reasonable enough given the extensions it's using. The other changes in this patch were the minimal set required to keep the tests passing after the move/forward change. Most notably the removal of the `__rv<unique_ptr>` hack that was present in an attempt to make unique_ptr move only without language support. llvm-svn: 364063
* Enable aligned_union in C++03Eric Fiselier2019-06-211-3/+0
| | | | llvm-svn: 364058
* Remove dead non-variadic workarounds in <type_traits>Eric Fiselier2019-06-211-414/+3
| | | | | | We can use variadics with clang llvm-svn: 364054
* Make rvalue metaprogramming traits work in C++03.Eric Fiselier2019-06-211-20/+0
| | | | | | The next step is to get move and forward working in C++03. llvm-svn: 364053
* Remove even more dead code.Eric Fiselier2019-06-212-240/+2
| | | | llvm-svn: 364050
* Assume __is_final, __is_base_of, and friends.Eric Fiselier2019-06-213-96/+4
| | | | | | | | | | All the compilers we support provide these builtins. We don't need to do a configuration dance anymore. This patch also cleans up some dead or almost dead C++11 feature detection macros. llvm-svn: 364047
* Remove dead config now that C++03 requires Clang.Eric Fiselier2019-06-211-16/+0
| | | | llvm-svn: 364031
* [libc++] Avoid using timespec when it might not be availableMikhail Maltsev2019-06-211-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The type timespec is unconditionally used in __threading_support. Since the C library is only required to provide it in C11, this might cause problems for platforms with external thread porting layer (i.e. when _LIBCPP_HAS_THREAD_API_EXTERNAL is defined) with pre-C11 C libraries. In our downstream port of libc++ we used to provide a definition of timespec in __external_threading, but this solution is not ideal because timespec is not a reserved name. This patch renames timespec into __libcpp_timespec_t in the thread-related parts of libc++. For all cases except external threading this type is an alias for ::timespec (and no functional changes are intended). In case of external threading it is expected that the __external_threading header will either provide a similar typedef (if timespec is available in the vendor's C library) or provide a definition of __libcpp_timespec_t compatible with POSIX timespec. Reviewers: ldionne, mclow.lists, EricWF Reviewed By: ldionne Subscribers: dexonsmith, libcxx-commits, christof, carwil Tags: #libc Differential Revision: https://reviews.llvm.org/D63328 llvm-svn: 364012
* [libc++] Recommit r363692 to implement P0608R3Zhihao Yuan2019-06-201-2/+30
| | | | | | | | | | | | Re-apply the change which was reverted in r363764 as-is after breakages being resolved. Thanks Eric Fiselier for working hard on this. See also: https://bugs.llvm.org/show_bug.cgi?id=42330 Differential Revision: https://reviews.llvm.org/D44865 llvm-svn: 363993
* [libc++] Take 2: Implement CTAD for map and multimapLouis Dionne2019-06-202-4/+73
| | | | | | | | | | | This is a re-application of r362986 (which was reverted in r363688) with fixes for the issue that caused it to be reverted. Thanks to Arthur O'Dwyer for the patch. Differential Revision: https://reviews.llvm.org/D58587 llvm-svn: 363968
* AIX system headers need stdint.h and inttypes.h to be re-enterableXing Xue2019-06-202-0/+10
| | | | | | | | | | | | | | | | | Summary: AIX system headers need stdint.h and inttypes.h to be re-enterable when macro _STD_TYPES_T is defined so that limit macro definitions such as UINT32_MAX can be found. This patch attempts to allow that on AIX. Reviewers: hubert.reinterpretcast, jasonliu, mclow.lists, EricWF Reviewed by: hubert.reinterpretcast, mclow.lists Subscribers: jfb, jsji, christof, cfe-commits, libcxx-commits, llvm-commits Tags: #LLVM, #clang, #libc++ Differential Revision: https://reviews.llvm.org/D59253 llvm-svn: 363939
* [NFC][libc++] Remove stray semi-colon after function definitionLouis Dionne2019-06-191-1/+1
| | | | llvm-svn: 363835
* [libc++] Revert r363692 which implements P0608R3Zhihao Yuan2019-06-191-30/+2
| | | | | | | The change caused a large number of compiler failures in Google's codebase. People need time to evaluate the impact. llvm-svn: 363764
* Remove GCC C++03 fallbacks for decltype and static_assert.Eric Fiselier2019-06-181-26/+2
| | | | | | | This means libc++ no longer needs to write extra braces in static asserts: Ex `static_assert((is_same_v<T, V>), "msg")`. llvm-svn: 363738
* Fix the floating point version of midpoint. It wasn't constexpr, among other ↵Marshall Clow2019-06-181-11/+18
| | | | | | things. Add more tests. As a drive-by, the LCD implementation had a class named '__abs' which did a 'absolute value to a common-type' conversion. Rename that to be '__ct_abs'. llvm-svn: 363714
* [libc++] Implement P0608R3 - A sane variant converting constructorZhihao Yuan2019-06-181-2/+30
| | | | | | | | | | | | | | | | | | Summary: Prefer user-defined conversions over narrowing conversions and conversions to bool. References: http://wg21.link/p0608 Reviewers: EricWF, mpark, mclow.lists Reviewed By: mclow.lists Subscribers: zoecarver, ldionne, libcxx-commits, cfe-commits, christof Differential Revision: https://reviews.llvm.org/D44865 llvm-svn: 363692
* [libc++] Revert the addition of map/multimap CTADLouis Dionne2019-06-182-71/+2
| | | | | | | | | | | | | This was found to be broken on Clang trunk. This is a revert of the following commits (the subsequent commits added XFAILs to the tests that were missing from the original submission): r362986: Implement deduction guides for map/multimap. r363014: Add some XFAILs r363097: Add more XFAILs r363197: Add even more XFAILs llvm-svn: 363688
* [libc++] Keep __regex_word in sync with ctype_baseMikhail Maltsev2019-06-142-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The class ctype_base in the header <__locale> contains masks for character classification functions, which are kept in sync with platform's C library, hence it contains many special cases. The value of the bit mask __regex_word in the header <regex> must not clash with those bit masks. Currently the default case (i.e. unknown platform/C library) is handled incorrectly: the __regex_word clashes with ctype_base::punct. To avoid replicating the whole list of platforms in <regex> this patch defines __regex_word in <__locale>, so that it is always kept in sync with other masks. Reviewers: ldionne, mclow.lists, EricWF Reviewed By: ldionne Subscribers: krytarowski, christof, dexonsmith, pbarrio, simon_tatham, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D63284 llvm-svn: 363363
* [libc++] Fix build with gcc 4.8Thomas Anderson2019-06-131-1/+1
| | | | | | | | | | | | gcc 4.8.4 (but not 5.4.0 or 7.3.0) has trouble initializing errc with {}, giving the error in [1]. This CL switches to explicitly using errc(0), which gcc 4.8 accepts. [1] https://bugs.chromium.org/p/chromium/issues/detail?id=973723 Differential Revision: https://reviews.llvm.org/D63296 llvm-svn: 363333
* Make GCC in C++03 UnsupportedEric Fiselier2019-06-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch make G++03 explicitly unsupported with libc++, as discussed on the mailing lists. Below is the rational for this decision. ---------------------------------------------------------------------------------------------------- libc++ claims to support GCC with C++03 ("G++03"), and this is a problem for our users. Our C++03 users are all using Clang. They must be. Less than 9% of the C++03 tests pass with GCC [1][2]. No non-trivial C++ program could work. Attempting to support G++03 impacts our QoI considerably. Unlike Clang, G++03 offers almost no C++11 extensions. If we could remove all the fallbacks for G++03, it would mean libc++ could:: * Improve Correctness: Every `#ifdef _LIBCPP_HAS_NO_<C++11-feature>` is a bug manifest. It exists to admit for deviant semantics. * Achieve ABI stability between C++03 and C++11 Differences between our C++03 and C++Rest branches contain ABI bugs. For example `std::nullptr_t` and `std::function::operator()(...)` are currently incompatible between C++11 and C++03, but could be fixed. * Decrease Compile Times and Memory Usage: Writing efficient SFINAE requires C++11. Using alias templates, libc++ could reduce the number of instantiations it produces substantially. * Decrease Binary Size Similar to the last point, G++03 forces metaprogramming techniques that emit more debug information [3] [4]. Compared to libstdc++, debug information size increases of +10% are not uncommon. Reviewers: ldionne, mclow.lists, EricWF Reviewed By: ldionne, EricWF Subscribers: zoecarver, aprantl, dexonsmith, arphaman, libcxx-commits, #libc Differential Revision: https://reviews.llvm.org/D63154 llvm-svn: 363219
* Apply [[nodebug]] to typedefs throughout the STL.Eric Fiselier2019-06-128-151/+160
| | | | | | | | | | | | | | | | When applied to a typedef or alias template, the [[nodebug]] attribute makes the typedef transparent to the debugger, so instead of seeing `std::__function::__alloc_func<remove_reference<void(&)()>::type, allocator<remove_reference<void(&)()>, void()>::_Target` you see `void(&)()` as the type of the variable in your debugger. Removing all this SFINAE noise from debug info has huge binary size wins, in addition to improving the readability. For now this change is on by default. Users can override it by specifying -D_LIBCPP_NODEBUG_TYPE= llvm-svn: 363117
* [libc++] Implement deduction guides for <set>Louis Dionne2019-06-111-2/+58
| | | | | | | | | | This is part of C++17's P0433. Thanks to Arthur O'Dwyer for the patch. Differential Revision: https://reviews.llvm.org/D58582 llvm-svn: 363090
* [libcxx] Make std::tuple<> trivially constructibleLouis Dionne2019-06-111-1/+1
| | | | | | | | | | | | | | | | | | | Summary: This is not mandated by the Standard, but it's nonetheless a nice property to have, especially since it's so easy to implement. It also shrinks our bug list! PR41714 Reviewers: mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D62618 llvm-svn: 363075
* [libcxx] Slightly improved policy for handling experimental featuresLouis Dionne2019-06-1110-169/+7
| | | | | | | | | | | | | | | | | | | | Summary: Following the discussion on the libcxx-dev mailing list (http://lists.llvm.org/pipermail/libcxx-dev/2019-May/000358.html), this implements the new policy for handling experimental features and their deprecation. We basically add a deprecation warning for std::experimental::filesystem, and we remove a bunch of <experimental/*> headers that were now empty. Reviewers: mclow.lists, EricWF Subscribers: mgorny, christof, jkorous, dexonsmith, arphaman, libcxx-commits, jfb Tags: #libc Differential Revision: https://reviews.llvm.org/D62428 llvm-svn: 363072
* Implement deduction guides for map/multimap. Reviewed as ↵Marshall Clow2019-06-102-2/+71
| | | | | | https://reviews.llvm.org/D58587. Thanks to Quuxplusone for the submission. llvm-svn: 362986
* Substantially reduce instantiations and debug size of std::functionEric Fiselier2019-06-083-19/+139
| | | | | | | | | | | | | | | | | std::function uses a standard allocator to manage its memory, however standard allocators are templates and using them correctly requires a stupid amount of instantiations. This leads to a substantial increase in debug info and object sizes. This patch addresses the issue by dropping the allocator when possible and using raw new and delete to get memory. This change decreases the object file size for the test func.wrap.func.con/F.pass.cpp by 33% and the final binary by 29% (when compiled with -g -ggnu-pubnames -gpubnames). It also roughly halfs the number of entries in the pubnames and pubtype sections. llvm-svn: 362865
* We had a _LIBCPP_ASSERT commented out because gcc 4.9 didn't like it. We ↵Marshall Clow2019-06-041-3/+3
| | | | | | (LLVM) now require GCC 5.1, so that's not a problem any more. Re-enable the assertion. Fixes PR#36863 llvm-svn: 362465
* [NFC][libcxx] Remove trailing whitespaceLouis Dionne2019-05-2918-124/+124
| | | | | | It's incredibly annoying when trying to create diffs llvm-svn: 361981
* Add additional constraints on midpoint(pointer, pointer). Fixes PR#42037.Marshall Clow2019-05-291-2/+5
| | | | llvm-svn: 361970
* Fix build breakage on 32-bit machinesEric Fiselier2019-05-291-1/+4
| | | | llvm-svn: 361917
* Rework std::type_info definition to support systems without fullyEric Fiselier2019-05-293-82/+157
| | | | | | | | | | | | | | | | | | merged type info names. Previously std::type_info always expected type info string to be unique. But this isn't always the case. Like when -Bsymbolic is passed to the linker or due to llvm.org/PR37398. This patch adds the LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT CMake option which, when specified, overrides the default configuration for the library. The current defaults still assume unique names even though this isn't strictly correct for ELF binaries. We should consider changing the default in a follow up commit. llvm-svn: 361913
* Fix an incorrect 'Throws' in the regex code. Add a test for the new ↵Marshall Clow2019-05-281-1/+1
| | | | | | behavior. Reviewed as https://reviews.llvm.org/D61828. Thanks to Mark for the catch and the fix. llvm-svn: 361887
* P0722R3: Implement library support for destroying deleteEric Fiselier2019-05-232-1/+18
| | | | | | | | | | | | | | | | | | Summary: This provides the `std::destroying_delete_t` declaration in C++2a and after. (Even when the compiler doesn't support the language feature). However, the feature test macro `__cpp_lib_destroying_delete` is only defined when we have both language support and C++2a. Reviewers: ldionne, ckennelly, serge-sans-paille, EricWF Reviewed By: EricWF Subscribers: dexonsmith, riccibruno, christof, jwakely, jdoerfert, mclow.lists, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D55840 llvm-svn: 361572
* [CMake] Copy C++ headers before configuring runtimes buildChris Bieneman2019-05-231-11/+19
| | | | | | | | | | | | | | | | Summary: On some platforms C++ headers are packaged with the compiler not the sysroot. If you don't copy C++ headers into the build include directory during configuraiton of the outer build the C++ check during the runtime configuration may get inaccurate results. Reviewers: phosek, compnerd, smeenai, EricWF Reviewed By: compnerd Subscribers: EricWF, christof, libcxx-commits, mgorny, llvm-commits Tags: #llvm, #libc Differential Revision: https://reviews.llvm.org/D62155 llvm-svn: 361513
* Ensure that hash<basic_string> uses char_traits. Fixes PR#41876. Reviewed as ↵Marshall Clow2019-05-201-13/+9
| | | | | | https://reviews.llvm.org/D61954 llvm-svn: 361201
* Fix missing std:: qualifier in __gnu_cxx::hash_map in C++03Eric Fiselier2019-05-171-1/+1
| | | | llvm-svn: 361075
* Remove `using namespace std;` in __gnu_cxx namespace.Eric Fiselier2019-05-173-63/+60
| | | | | | | | The `using namespace std;` opens us up to ambiguity when any of the std:: names are also present in the global namespace. Instead we should properly qualify names we use from std::. llvm-svn: 361074
* Mark private function __sign as constexpr.Marshall Clow2019-05-071-1/+1
| | | | llvm-svn: 360167
* Remove unneeded <algorithm> include in cmath.Eric Fiselier2019-05-061-1/+0
| | | | | | | It's a remnant from an earlier version of the lerp change and is unneeded. llvm-svn: 360098
* [WebAssembly] WASI support for libcxxDan Gohman2019-05-012-3/+7
| | | | | | | | | | | | | This adds explicit support for the WASI platform to libcxx. WASI libc uses some components from musl, however it's not fully compatible with musl, so we're planning to stop using _LIBCPP_HAS_MUSL_LIBC and customize for WASI libc specifically. Differential Revision: https://reviews.llvm.org/D61336 Reviewers: sbc100, ldionne llvm-svn: 359703
* Support overaligned types in `aligned_storage`.Eric Fiselier2019-04-301-2/+4
| | | | | | | | | | | | | | | | | Summary: The current implementation of aligned storage was written before we had `alignas`, so it used a list of builtin types to force the alignment. But this doesn't work overaligned requests. This patch adds a fallback case supporting over-alignment. It only affects case that were previously ill-formed. Reviewers: rsmith, ldionne, dlj, mclow.lists Reviewed By: mclow.lists Subscribers: mclow.lists, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D61301 llvm-svn: 359596
* Implement LWG 2960: nonesuch is insufficiently uselessMarshall Clow2019-04-301-5/+5
| | | | llvm-svn: 359526
OpenPOWER on IntegriCloud