summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix and speedup __libcpp_locale_guard on WindowsThomas Anderson2019-03-271-19/+33
| | | | | | | | | | | | | | The old implementation assumed the POSIX `setlocale()` API where the old locale is returned. On Windows, the _new_ locale is returned. This meant that `__libcpp_locale_guard` wasn't resetting the locale on destruction. The new implementation fixes the above issue and takes advantage of `setlocale(LC_ALL)` to reduce the number of calls, and also avoids setting the locale at all if it's not necessary. Differential Revision: https://reviews.llvm.org/D59572 llvm-svn: 357104
* Fix occurrences of _LIBCPP_ASSERT in span testsCasey Carter2019-03-273-8/+8
| | | | llvm-svn: 357092
* [libc++] Add proper XFAILs for shared_mutex testsLouis Dionne2019-03-2715-2/+17
| | | | | | | | | | Dylib support for shared_mutex was added in macOS 10.12, so the tests should be XFAILed accordingly instead of being completely disabled whenever availability is enabled. rdar://problem/48769104 llvm-svn: 357079
* [libc++] Fix return value of snprintf_l() on Windows when buffer is too smallThomas Anderson2019-03-261-4/+5
| | | | | | | | | | | | | | | | | When the output buffer is too small to contain the output, `vsnprintf()` fills the buffer and returns the number of characters that __would have__ been written if the buffer was sufficiently large. `_vnsprintf_s()` on the other hand fills the buffer and returns -1 when this happens. We want the former behavior, but we also want to be able to pass in a locale to prevent having to call `setlocale()`. `__stdio_common_vsprintf()` is the only function general enough to get the behavior we want. Differential Revision: https://reviews.llvm.org/D59727 llvm-svn: 357024
* Revert "[coroutines] Add std::experimental::task<T> type"Brian Gesiak2019-03-2615-1687/+8
| | | | | | | | This revision is causing build and test failures, such as http://lab.llvm.org:8011/builders/libcxx-libcxxabi-libunwind-armv8-linux/builds/648/steps/test.libcxx/logs/stdio, so I'll revert it. llvm-svn: 357023
* [coroutines] Add std::experimental::task<T> typeBrian Gesiak2019-03-2615-8/+1687
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adds the coroutine `std::experimental::task<T>` type described in proposal P1056R0. See https://wg21.link/P1056R0. This implementation allows customization of the allocator used to allocate the coroutine frame by passing std::allocator_arg as the first argument, followed by the allocator to use. This supports co_awaiting the same task multiple times. The second and subsequent times it returns a reference to the already-computed value. This diff also adds some implementations of other utilities that have potential for standardization as helpers within the test/... area: - `sync_wait(awaitable)` - See P1171R0 - `manual_reset_event` Move the definition of the __aligned_allocation_size helper function from <experimental/memory_resource> to <experimental/__memory> so it can be more widely used without pulling in memory_resource. Outstanding work: - Use C++14 keywords directly rather than macro versions eg. use `noexcept` instead of `_NOEXCEPT`). - Add support for overaligned coroutine frames. This may need wording in the Coroutines TS to support passing the extra `std::align_val_t`. - Eliminate use of `if constexpr` if we want it to compile under C++14. Patch by @lewissbaker (Lewis Baker). llvm-svn: 357010
* Cleaup of requirements for optional. While researching LWG3196, I realized ↵Marshall Clow2019-03-252-1/+50
| | | | | | that optional did not reject 'const in_place_t' like it should. Added a test as well, and a check for arrays (which were already disallowed, but now we get a better error message). Should not affect anyone's code. llvm-svn: 356918
* [libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platformsLouis Dionne2019-03-253-11/+12
| | | | | | | | | | | | | | | | | | | | Summary: I can't see a good reason to disallow this, even though it isn't the standard way we build libc++ for Apple platforms. Making this work on Apple platforms requires using different flags for --whole-archive and removing the -D flag when running `ar` to merge archives because that flag isn't supported by the `ar` shipped on Apple platforms. This shouldn't be an issue since the -D option appears to be enabled by default in GNU `ar`. Reviewers: phosek, EricWF, serge-sans-paille Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D59513 llvm-svn: 356903
* Fix a minor bug with std::next and prev not and negative numbers. In ↵Marshall Clow2019-03-226-18/+157
| | | | | | particular, std::prev cannot require Bidirectional Iterators, because you might 'go back' -1 places, which goes forward. Thanks to Ville and Jonathan for the bug report. llvm-svn: 356818
* [libc++] Update the list of symbols exported from libc++abi for new/deleteLouis Dionne2019-03-221-2/+14
| | | | | | | | When libc++ does not provide new/delete, libc++abi now also provides the aligned allocation and deallocation functions, so those should be part of the re-export list for libc++. llvm-svn: 356804
* [libc++] Re-export the sjlj ABI v2 for ARM architecturesLouis Dionne2019-03-222-1/+311
| | | | | | We were previously not exporting the right ABI version of libc++abi. llvm-svn: 356798
* Fix a vector test to not use a local type as a template parameter. This ↵Marshall Clow2019-03-221-7/+9
| | | | | | causes a warning on C++03. NFC llvm-svn: 356726
* [libc++] Remove too-stringent XFAILs for file_clock testsLouis Dionne2019-03-213-4/+0
| | | | | | | Those tests actually pass because we don't use anything that's marked as unavailable. llvm-svn: 356719
* [NFC][libc++] Reindent #ifdefsLouis Dionne2019-03-211-12/+12
| | | | | | | | I don't understand why we don't always do that. We do it for normal `if`s in the code, but not for preprocessor `if`s? It's a lot more readable when indented properly. llvm-svn: 356693
* [libc++] Re-document how to use <filesystem> with various versions of libc++Louis Dionne2019-03-211-0/+10
| | | | | | | | | This documentation was removed when we added <filesystem> to the dylib in r356518, but it really should have been updated to reflect the new state of things. Keeping documentation around doesn't hurt and users will have an easier time migrating. llvm-svn: 356681
* Add relational benchmark against a string constant.Samuel Benzaquen2019-03-211-4/+44
| | | | | | | | | | | | | | | | | Summary: Add relational benchmark against a string constant. These can potentially trigger inlining of the operations. We want to benchmark that. Reviewers: EricWF Subscribers: christof, jdoerfert, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D59512 llvm-svn: 356680
* [libc++] Mark bad_any_cast tests as unsupported when the dylib doesn't ↵Louis Dionne2019-03-213-12/+3
| | | | | | | | | support bad_any_cast With the latest compiler fix to availability, some availability failures that didn't trigger before now trigger. llvm-svn: 356678
* Add dylib-has-no-filesystem when filesystem is disabledEric Fiselier2019-03-211-0/+2
| | | | llvm-svn: 356640
* Mark debug death tests as unsupported on WindowsEric Fiselier2019-03-2111-2/+11
| | | | llvm-svn: 356639
* Remove type visibility specifiers from new chrono types.Eric Fiselier2019-03-211-18/+18
| | | | | | | | | _LIBCPP_TYPE_VIS is only really needed on types with a vtable. And on Windows it doesn't work with types that have only inline methods. This patch removes the unneeded attributes. llvm-svn: 356637
* [libcxx] [test] Revert r356632 add (void) casts to operator new calls, to ↵Billy Robert O'Neal III2019-03-216-6/+6
| | | | | | suppress warnings generated by [[nodiscard]]." llvm-svn: 356635
* Allow disabling of filesystem library.Eric Fiselier2019-03-218-8/+33
| | | | | | | | | | | | | | Summary: Filesystem doesn't work on Windows, so we need a mechanism to turn it off for the time being. Reviewers: ldionne, serge-sans-paille, EricWF Reviewed By: EricWF Subscribers: mstorsjo, mgorny, christof, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D59619 llvm-svn: 356633
* [libcxx] [test] Add (void) casts to operator new calls, to suppress warnings ↵Billy Robert O'Neal III2019-03-206-6/+6
| | | | | | | | generated by [[nodiscard]]. This allows these tests to pass when compiled by MSVC++. llvm-svn: 356632
* libc++/win: Make once_flag have the same size as a pointer.Nico Weber2019-03-202-13/+22
| | | | | | | | | | | | | | | | | | | | | | `unsigned long` is 32-bit on 32-bit systems and 64-bit on 64-bit systems on LP64 systems -- which most Unix systems are, but Windows isn't. Windows is LLP64, which means unsigned long is 32-bit even on 64-bit systems. pplwin.h contains static_assert(alignof(void *) == alignof(::std::once_flag), ...) which fails due to this problem. Instead of unsigned long, use uintptr_t, which consistently is 32-bit on 32-bit systems and 64-bit on 64-bit systems. No functional change except on 64-bit Windows. Differential Revision: https://reviews.llvm.org/D59607 llvm-svn: 356624
* [libc++] Mark <filesystem> as unavailable on Apple platforms using pragmasLouis Dionne2019-03-206-3/+30
| | | | | | | | | | | | | | | | | | | | | Summary: Also add the corresponding XFAILs to tests that require filesystem. The approach taken to mark <filesystem> as unavailable in this patch is to mark all the header as unavailable using #pragma clang attribute. Marking each declaration using the attribute is more intrusive and does not provide a lot of value right now because pretty much everything in <filesystem> requires dylib support, often transitively. This is an alternative to https://reviews.llvm.org/D59093. A similar (but partial) patch was already applied in r356558. Reviewers: mclow.lists, EricWF, serge-sans-paille Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D59224 llvm-svn: 356616
* Mark <charconv> tests as unsupported for C++11 and C++14 if you're not ↵Marshall Clow2019-03-204-0/+8
| | | | | | testing libc++. Thanks to Louis for the suggestion. llvm-svn: 356602
* [libc++] Use the compiler that CMake found when running lit for ↵Louis Dionne2019-03-201-1/+0
| | | | | | back-deployment tests llvm-svn: 356595
* [libc++][CMake] Clean up some of the libc++ re-exporting logicLouis Dionne2019-03-208-28/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: This change allows specifying the version of libc++abi's ABI to re-export when configuring CMake. It also clearly identifies which ABI version of libc++abi each export file contains. Finally, it removes hardcoded knowledge about the 10.9 SDK for MacOS, since that knowledge is not relevant anymore. Indeed, libc++ can't be built with the toolchain that came with the 10.9 SDK anyway because the version of Clang it includes is too old (for example if you want to build a working libc++.dylib, you need bugfixes to visibility attributes that are only in recent Clangs). Reviewers: dexonsmith, EricWF Subscribers: mgorny, christof, jkorous, arphaman, libcxx-commits Differential Revision: https://reviews.llvm.org/D59489 llvm-svn: 356587
* Make to_chars/from_chars work back to C++11. This means that we can use them ↵Marshall Clow2019-03-206-27/+28
| | | | | | to implement to_string as well. Reviewed as https://reviews.llvm.org/D59598. llvm-svn: 356585
* [NFC] Fix a couple of typos in libc++'s __configLouis Dionne2019-03-201-4/+4
| | | | llvm-svn: 356574
* [libc++] Do not force going through xcrun to find Clang in the macOS CI scriptsLouis Dionne2019-03-202-6/+1
| | | | | | | It should be possible to run those CI scripts with different compilers by simply exporting a different CXX environment variable. llvm-svn: 356562
* [libc++] Mark <filesystem> tests as failing when the dylib doesn't support ↵Louis Dionne2019-03-2013-8/+32
| | | | | | | | | | | | filesystem This fixes CI for back-deployment testers on platforms that don't have <filesystem> support in the dylib. This is effectively half of https://reviews.llvm.org/D59224. The other half requires fixes in Clang. llvm-svn: 356558
* [libc++] Flag file_clock test as expected to fail with ASANLouis Dionne2019-03-191-0/+4
| | | | | | | This silences a known issue, as can be seen by looking at similar tests for other clocks, like time.clock.steady/consistency.pass.cpp. llvm-svn: 356528
* [libc++] Complete the ABI changelog after landing <filesystem> in the dylibLouis Dionne2019-03-191-2/+72
| | | | llvm-svn: 356523
* [libc++] Build <filesystem> support as part of the dylibLouis Dionne2019-03-1917-135/+210
| | | | | | | | | | | | | | | | | | | Summary: This patch treats <filesystem> as a first-class citizen of the dylib, like all other sub-libraries (e.g. <chrono>). As such, it also removes all special handling for installing the filesystem library separately or disabling part of the test suite from the lit command line. Unlike the previous attempt (r356500), this doesn't remove all the filesystem tests. Reviewers: mclow.lists, EricWF, serge-sans-paille Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D59152 llvm-svn: 356518
* [libc++] Speed up certain locale functions on WindowsThomas Anderson2019-03-191-0/+6
| | | | | | | | | | | The issue is that __libcpp_locale_guard makes some slow calls to setlocale(). This change avoids using __libcpp_locale_guard in snprintf_l(). Fixes https://bugs.llvm.org/show_bug.cgi?id=41131 Differential Revision: https://reviews.llvm.org/D59525 llvm-svn: 356512
* Revert "[libc++] Build <filesystem> support as part of the dylib"Louis Dionne2019-03-19163-210/+14305
| | | | | | | | When I applied r356500 (https://reviews.llvm.org/D59152), I somehow deleted all of filesystem's tests. I will revert r356500 and re-apply it properly. llvm-svn: 356505
* Fix char.traits.specializations.char8_t main returnJF Bastien2019-03-194-0/+4
| | | | llvm-svn: 356504
* Fixup ABI lists on Linux after adding <filesystem> to the dylib.Eric Fiselier2019-03-191-0/+71
| | | | llvm-svn: 356503
* Add visibility attributes and inline to some vector methods.Eric Fiselier2019-03-191-3/+8
| | | | | | | Adding filesystem to the dylib caused some vector symbols to leak into the set of exported symbols. This patch hides those symbols. llvm-svn: 356502
* [libc++] Build <filesystem> support as part of the dylibLouis Dionne2019-03-19163-14305/+210
| | | | | | | | | | | | | | | | Summary: This patch treats <filesystem> as a first-class citizen of the dylib, like all other sub-libraries (e.g. <chrono>). As such, it also removes all special handling for installing the filesystem library separately or disabling part of the test suite from the lit command line. Reviewers: mclow.lists, EricWF, serge-sans-paille Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D59152 llvm-svn: 356500
* Fix fenv.pass.cpp signature for mainJF Bastien2019-03-191-3/+1
| | | | | | And make main return. llvm-svn: 356493
* [libc++] Mark internal types of std::filesystem as hiddenLouis Dionne2019-03-191-3/+3
| | | | | | | | | | | | | | | | | | Summary: Otherwise, implicit instantiations of templates with these types can cause the dylib to start exporting the vtable/RTTI of the instantiation. Giving hidden visibility to those types causes the compiler to understand that they are not used outside the dylib, and as a result implicitly instantiated vtables/RTTI of templates with those internal types will get hidden visibility. Reviewers: EricWF Subscribers: christof, jkorous, dexonsmith, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D59550 llvm-svn: 356488
* Mark 'front()' and 'back()' as noexcept for array/deque/string/string_view. ↵Marshall Clow2019-03-1912-45/+94
| | | | | | These are just rebranded 'operator[]', and should be noexcept like it is. llvm-svn: 356435
* Remove unused try catch blocks from old debug testsEric Fiselier2019-03-191-26/+14
| | | | llvm-svn: 356429
* Fix test failures after debug mode changesEric Fiselier2019-03-181-3/+3
| | | | llvm-svn: 356421
* Remove exception throwing debug mode handler support.Eric Fiselier2019-03-1827-769/+910
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The reason libc++ implemented a throwing debug mode handler was for ease of testing. Specifically, I thought that if a debug violation aborted, we could only test one violation per file. This made it impossible to test debug mode. Which throwing behavior we could test more! However, the throwing approach didn't work either, since there are debug violations underneath noexcept functions. This lead to the introduction of `_NOEXCEPT_DEBUG`, which was only noexcept when debug mode was off. Having thought more and having grown wiser, `_NOEXCEPT_DEBUG` was a horrible decision. It was viral, it didn't cover all the cases it needed to, and it was observable to the user -- at worst changing the behavior of their program. This patch removes the throwing debug handler, and rewrites the debug tests using 'fork-ing' style death tests. Reviewers: mclow.lists, ldionne, thomasanderson Reviewed By: ldionne Subscribers: christof, arphaman, libcxx-commits, #libc Differential Revision: https://reviews.llvm.org/D59166 llvm-svn: 356417
* [libc++][NFC] Promote CMake comment to an actual option descriptionLouis Dionne2019-03-181-3/+3
| | | | llvm-svn: 356386
* [libc++] Add a test for PR40977Louis Dionne2019-03-181-0/+34
| | | | | | | Even though the header makes the exact same check since https://llvm.org/D59063, the headers could conceivably change in the future and introduce a bug. llvm-svn: 356376
* Update a deque test with more assertions. NFCMarshall Clow2019-03-151-6/+6
| | | | llvm-svn: 356266
OpenPOWER on IntegriCloud