summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
...
* [libc++] Remove old workaround for builditLouis Dionne2019-04-161-6/+2
| | | | | | | | | | | | | | | | | | | | Summary: I'm not sure what the problem was at the time, however I don't think this is necessary since buildit doesn't exist anymore. Instead of the workaround, the correct thing to do is to leave out the get_new_handler/set_new_handler definitions from libc++ when we're getting them from libc++abi. Reviewers: EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D60717 llvm-svn: 358518
* [libc++] Fix debug_less test in C++03Louis Dionne2019-04-151-9/+9
| | | | | | We were using C++11 features but the test needs to work in C++03 too. llvm-svn: 358433
* [libc++] Fix build failure with _LIBCPP_DEBUG=0 when iterators return values ↵Thomas Anderson2019-04-152-0/+44
| | | | | | | | | | | | | | | | | | | instead of references There are many STL algorithms (such as lexicographical_compare) that compare values pointed to by iterators like so: __comp(*it1, *it2); When building with `_LIBCPP_DEBUG=0`, comparators are wrapped in `__debug_less` which does some additional validation. But `__debug_less::operator()` takes non-const references, so if the type of `*it1` is int, not int&, then the build will fail. This change adds a `const&` overload for `operator()` to fix the build. Differential Revision: https://reviews.llvm.org/D60592 llvm-svn: 358423
* [NFC] Add missing revision number in libc++ ABI changelogLouis Dionne2019-04-151-1/+1
| | | | llvm-svn: 358411
* [libc++] Make sure that the symbol differ takes into account symbol typesLouis Dionne2019-04-151-3/+3
| | | | | | | | | | | | | | | | | Summary: Otherwise, it doesn't take into account things like whether the symbol is defined or undefined, and whether symbols are indirect references (re-exports) or not. Reviewers: EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D60416 llvm-svn: 358408
* [libc++] Run back-deployment CI against previously-released libc++abi dylibsLouis Dionne2019-04-123-7/+3
| | | | | | | | | | | We used to do it against the current system's libc++abi, which is not as good as doing it with the libc++abi that matches the libc++ we're running against. Note that I made sure we were indeed picking up the provided libc++abi by replacing it by something that doesn't work and watching it burn. llvm-svn: 358294
* Cleanup how debug comparators are created in <algorithm>Eric Fiselier2019-04-121-151/+38
| | | | | | | | | | Instead of having an `#if` block in every algorithm using a debug comparator, this patch introduces the __comp_ref_type trait that selects __debug_less in debug mode and _Comp& otherwise. This patch should have no observable functionality change. llvm-svn: 358252
* [libc++] Make sure we don't eagerly diagnose non-const comparators for ↵Louis Dionne2019-04-1110-21/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | containers of incomplete types Summary: In r348529, I improved the library-defined diagnostic for using containers with a non-const comparator/hasher. However, the check is now performed too early, which leads to the diagnostic being emitted in cases where it shouldn't. See PR41360 for details. This patch moves the diagnostic to the destructor of the containers, which means that the diagnostic will only be emitted when the container is instantiated at a point where the comparator and the key/value are required to be complete. We still retain better diagnostics than before r348529, because the diagnostics are performed in the containers themselves instead of __tree and __hash_table. As a drive-by fix, I improved the diagnostic to mention that we can't find a _viable_ const call operator, as suggested by EricWF in PR41360. Reviewers: EricWF, mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits, zoecarver Tags: #libc Differential Revision: https://reviews.llvm.org/D60540 llvm-svn: 358189
* Remove repeated words from BuildingLibcxx.rstJonathan Metzman2019-04-101-1/+1
| | | | | | | | | | | | | | Summary: Remove repeated words from docs. Reviewers: phosek Reviewed By: phosek Subscribers: christof Differential Revision: https://reviews.llvm.org/D60530 llvm-svn: 358147
* [CMake] Fix statically linking in libcxxabi if built separatelyMartin Storsjo2019-04-091-2/+2
| | | | | | | | | | | In this case, CMake doesn't know about the c++abi target within the same CMake run. This reverts this aspect back to how it was before SVN r357811. Differential Revision: https://reviews.llvm.org/D60448 llvm-svn: 358009
* [libc++] Remove install_name and compatibility_version on OS XLouis Dionne2019-04-081-2/+0
| | | | | | | | | | | | | | | CMake already specifies those, and we never actually want those to be used. In fact, r357811 re-ordered those flags in a way that the explicitly-provided install_name was overriding the CMake-provided install_name (instead of the other way around). This caused the dylib to be considered a system dylib, and hence the explicitly provided rpath to be ignored. This, in turn, caused some unit tests to start linking against the system libc++.dylib instead of the freshly-built one. Specifically, the unit tests that started linking against the system dylib are those that didn't specify a DYLD_LIBRARY_PATH, such as last_write_time.sh.cpp. llvm-svn: 357946
* [libc++][CMake] Make sure the benchmarks link against libc++abiLouis Dionne2019-04-051-1/+2
| | | | | | | | | | | | | | The refactoring in r357811 made it so that we didn't add the ABI library to the list of LIBCXX_LIBRARIES. As a result, benchmarks didn't link to the ABI library and were missing symbols. This broke the build bots. As a drive-by fix, we also provide the SHARED ABI library to the linker script instead of the STATIC ABI library. This couldn't be discovered on Apple platforms because libc++.dylib re-exports libc++abi.dylib symbols there. llvm-svn: 357818
* [libc++] Localize CMake code only related to the shared libraryLouis Dionne2019-04-051-68/+64
| | | | | | | | | | | | | | | | | | Summary: There's a lot of CMake logic that's only relevant to the shared library, yet it was using a code path and setting variables that impact both the shared and the static libraries. This patch moves this logic so that it clearly only impacts the shared library. Reviewers: phosek, smeenai, EricWF Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D60276 llvm-svn: 357811
* [libc++] Add XFAILs for istream tests that were added in r357775Louis Dionne2019-04-0521-0/+143
| | | | | | | | We fixed incorrect behavior of input streams in r357775 and tests were added accordingly. However, older versions of macOS don't have the change in the dylib yet, so the tests fail on those platforms. llvm-svn: 357794
* [libc++] Fix error flags and exceptions propagated from input stream operationsLouis Dionne2019-04-0542-533/+2480
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a re-application of r357533 and r357531. They had been reverted because we thought the commits broke the LLDB data formatters, but it turns out this was because only r357531 had been included in the CI run. Before this patch, we would only ever throw an exception if the badbit was set on the stream. The Standard is currently very unclear on how exceptions should be propagated and what error flags should be set by the input stream operations. This commit changes libc++ to behave under a different (but valid) interpretation of the Standard. This interpretation of the Standard matches what other implementations are doing. This effectively implements the wording in p1264r0. It hasn't been voted into the Standard yet, however there is wide agreement that the fix is correct and it's just a matter of time before the fix is standardized. PR21586 PR15949 rdar://problem/15347558 Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D49863 llvm-svn: 357775
* Handle TLS values in sym_checkEric Fiselier2019-04-041-1/+1
| | | | llvm-svn: 357705
* Try to suppress nodiscard_extension failures with Xcode 9Nico Weber2019-04-042-0/+8
| | | | | | See https://crbug.com/949509 for the error message. llvm-svn: 357692
* Cleanup test failures in no discard tests.Eric Fiselier2019-04-032-0/+26
| | | | llvm-svn: 357637
* Attempt to upgrade compiler used by appveyor buildsEric Fiselier2019-04-031-1/+1
| | | | llvm-svn: 357632
* disable appveyor config for MSVC 2015Eric Fiselier2019-04-031-5/+6
| | | | llvm-svn: 357631
* libcxx: Add _LIBCPP_NODISCARD_EXT to 38 more functionsNico Weber2019-04-034-84/+536
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This builds on the work done in r342808 and adds _LIBCPP_NODISCARD_EXT to 37 more functions, namely: adjacent_find, all_of, any_of, binary_search, clamp, count_if, count, equal_range, equal, find_end, find_first_not_of, find_first_of, find_if, find, includes, is_heap_until, is_heap, is_partitioned, is_permutation, is_sorted_until, is_sorted, lexicographical_compare, lower_bound, max_element, max, min_element, min, minmax_element, minmax, mismatch, none_of, remove_if, remove, search_n, search, unique, upper_bound The motivation here is that we noticed that find_if is nodiscard with Visual Studio's standard library, and we deemed that useful (https://crbug.com/948122). https://devblogs.microsoft.com/cppblog/c17-progress-in-vs-2017-15-5-and-15-6/ says "Our criteria for emitting the warning are: discarding the return value is a guaranteed leak [...], discarding the return value is near-guaranteed to be incorrect (e.g. remove()/remove_if()/unique()), or the function is essentially a pure observer (e.g. vector::empty() and std::is_sorted())." so I went through algorithm and tried to apply these criteria. Some of these, like vector::empty() are already nodiscard per C++ standard and didn't need changing. I didn't (yet?) go over std::string::find* methods which should probably have _LIBCPP_NODISCARD_EXT too (but not as part of this change). Differential Revision: https://reviews.llvm.org/D60145 llvm-svn: 357619
* [libc++] Use std::is_nothrow_callable for std::invoke according to LWG 2807Louis Dionne2019-04-033-5/+10
| | | | | | | Thanks to Zoe Carver for the patch. Differential Revision: https://reviews.llvm.org/D58097 llvm-svn: 357616
* Add more benchmarks for literal strings.Samuel Benzaquen2019-04-031-10/+42
| | | | | | | | | | | | | | | | | | Summary: Comparing against the empty string should generate much better code that what it does today. We can also generate better code when comparing against literals that are larger than the SSO space. Reviewers: EricWF Subscribers: christof, jdoerfert, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D59781 llvm-svn: 357614
* [libc++][NFC] Rename test file according to the libc++ conventionLouis Dionne2019-04-031-0/+0
| | | | llvm-svn: 357588
* [libc++] (Take 2) Correctly handle Objective-C++ ARC qualifiers in ↵Louis Dionne2019-04-032-1/+73
| | | | | | | | | | | | | | | | | | | | | std::is_pointer Summary: Otherwise, std::is_pointer<id __strong> works, but std::is_pointer<id __weak> (and others) don't work as expected. The previous patch (r357517) had to be reverted in r357569 because it broke the Chromium build. This patch shouldn't have the same problem. rdar://problem/49126333 Reviewers: ahatanak, EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D60087 llvm-svn: 357586
* Revert "[libc++] Correctly handle Objective-C++ ARC qualifiers in ↵Hans Wennborg2019-04-032-61/+0
| | | | | | | | | | | | | | | | | | | | std::is_pointer" This broke the Chromium build on Mac, see https://crbug.com/949071 > Summary: > Otherwise, std::is_pointer<id __strong> works, but std::is_pointer<id __weak> > (and others) don't work as expected. > > rdar://problem/49126333 > > Reviewers: ahatanak, EricWF > > Subscribers: christof, jkorous, dexonsmith, libcxx-commits > > Differential Revision: https://reviews.llvm.org/D60087 llvm-svn: 357569
* [CMake] Differentiate between static and shared libc++abiPetr Hosek2019-04-032-22/+25
| | | | | | | | | | | | | | | This addresses the issue introduced in r354212 which broke the case when static libc++abi is merged into static libc++, but shared libc++ is linked against shared libc++. There are 4 different possible combinations which is difficult to capture using a single variable. This change splits LIBCXX_CXX_ABI_LIBRARY into two: LIBCXX_CXX_SHARED_ABI_LIBRARY and LIBCXX_CXX_STATIC_ABI_LIBRARY to handle the shared and static cases. This in turn allows simplification of some of the logic around merging of static archives. Differential Revision: https://reviews.llvm.org/D60114 llvm-svn: 357556
* [libcxx] [test] Add missing <stdexcept> to name std::out_of_range to ↵Billy Robert O'Neal III2019-04-031-2/+3
| | | | | | string.conversions\stold.pass.cpp. llvm-svn: 357547
* [libcxx] [test] Use ptrdiff_t rather than int in splice_after_range.pass.cpp ↵Billy Robert O'Neal III2019-04-031-23/+24
| | | | | | | | to avoid narrowing from pointer subtraction to int warnings. Reviewed as https://reviews.llvm.org/D60104 llvm-svn: 357546
* [libcxx] [test] Fix test bugs in string.cons/copy_alloc.pass.cpp.Billy Robert O'Neal III2019-04-031-6/+7
| | | | | | | | | | | | | | Fixed the inability to properly rebind the testing allocator, by making the inner alloc_impl type a plain struct and making the operations templates. Before rebind failed to compile complaining that a alloc_impl<T>* was not convertible to an alloc_impl<U>*. This enables the test to pass for MSVC++ once we provide the strong guarantee for the copy assignment operator. Reviewed as https://reviews.llvm.org/D60023 llvm-svn: 357545
* Fix backwards test that I committed yesterday. SighMarshall Clow2019-04-031-2/+2
| | | | llvm-svn: 357540
* Revert "[libc++] Fix error flags and exceptions propagated from input stream ↵Louis Dionne2019-04-0242-2480/+533
| | | | | | | | | | operations" This reverts commits r357533 and r357531, which broke the LLDB data formatters. I'll hold off until we know how to fix the data formatters accordingly. llvm-svn: 357536
* [libc++] Fix build when exceptions are turned offLouis Dionne2019-04-021-1/+1
| | | | llvm-svn: 357533
* [libc++] Fix error flags and exceptions propagated from input stream operationsLouis Dionne2019-04-0242-533/+2480
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this patch, we would only ever throw an exception if the badbit was set on the stream. The Standard is currently very unclear on how exceptions should be propagated and what error flags should be set by the input stream operations. This commit changes libc++ to behave under a different (but valid) interpretation of the Standard. This interpretation of the Standard matches what other implementations are doing. I will submit a paper in San Diego to clarify the Standard such that the interpretation used in this commit (and other implementations) is the only possible one. PR21586 PR15949 rdar://problem/15347558 Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D49863 llvm-svn: 357531
* [libc++] Correctly handle Objective-C++ ARC qualifiers in std::is_pointerLouis Dionne2019-04-022-0/+61
| | | | | | | | | | | | | | | | Summary: Otherwise, std::is_pointer<id __strong> works, but std::is_pointer<id __weak> (and others) don't work as expected. rdar://problem/49126333 Reviewers: ahatanak, EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D60087 llvm-svn: 357517
* [libc++] Remove use of auto with actual typeLouis Dionne2019-04-021-2/+2
| | | | | | For compatibility with C++03. llvm-svn: 357512
* [libc++][NFC] Remove useless public: label at the end of classLouis Dionne2019-04-021-1/+0
| | | | llvm-svn: 357511
* Special case some duration arithmetic for GCC and PPC because their long ↵Marshall Clow2019-04-021-0/+5
| | | | | | double constant folding is broken. Fixes PR#39696. llvm-svn: 357478
* Fix typo that I introduced in r357413. Thanks to ensadc@mailnesia.com for ↵Marshall Clow2019-04-021-1/+2
| | | | | | the catch. llvm-svn: 357474
* Fix a number of bugs in __val_expr's subset operator[].Eric Fiselier2019-04-029-222/+359
| | | | | | | | The current definitions were entirely broken. They didn't call any existing constructor and the forgot to friend the expression types they were trying to construct. llvm-svn: 357453
* [libcxx] Make sure reference_wrapper works with incomplete typesLouis Dionne2019-04-015-1/+163
| | | | | | | | | | | | Summary: Completes P0357R3, which was merged into the C++20 Working Draft in San Diego. Reviewers: EricWF, mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D54722 llvm-svn: 357423
* Fix PR#41323 'Race condition in steady_clock::now for _LIBCPP_WIN32API'. ↵Marshall Clow2019-04-011-6/+15
| | | | | | thanks to Ivan Afanasyev for the report. llvm-svn: 357413
* [libc++] Declare std::tuple_element as struct instead of classLouis Dionne2019-04-019-32/+19
| | | | | | | | | | | | Similarly to https://reviews.llvm.org/rL350972, this revision changes std::tuple_element from class to struct. Fixes PR41331. Thanks to Jan Wilken Dörrie for the patch. Differential Revision: https://reviews.llvm.org/D60069 llvm-svn: 357411
* Fix PR41130 - 'operator/ of std::chrono::duration and custom type'. Thanks ↵Marshall Clow2019-04-019-28/+139
| | | | | | to Zulan for the report, and Howard for the direction of the fix. llvm-svn: 357410
* Make common_type's implementation common Eric Fiselier2019-03-312-152/+154
| | | | | | | | | | | | | | | | | | | Summary: Currently the C++03 implementation of common_type has much different behavior than the C++11 one. This causes bugs, including inside `<chrono>`. This patch unifies the two implementations as best it can. The more code they share, the less their behavior can diverge. Reviewers: mclow.lists, ldionne, sbenza Reviewed By: mclow.lists, ldionne Subscribers: libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D59678 llvm-svn: 357370
* Mark fenv.h as a system header before the #include_next directiveEric Fiselier2019-03-291-1/+2
| | | | | | | | This fixes a -Wgnu-include-next warning Patch by dmauro. llvm-svn: 357267
* Fix PR#35967: '<regex> syntax_option_type is not a proper bitmask' Sadly, ↵Marshall Clow2019-03-284-13/+51
| | | | | | this is an ABI break, so it's only available if you define either '_LIBCPP_ABI_VERSION > 2' or '_LIBCPP_ABI_UNSTABLE' or '_LIBCPP_ABI_REGEX_CONSTANTS_NONZERO' and rebuild your dylib. llvm-svn: 357190
* [libc++] Remove unnecessary <iostream> #includes in testsLouis Dionne2019-03-2825-46/+4
| | | | | | | Some tests #include <iostream> but they don't use anything from the header. Those are probably artifacts of when the tests were developped. llvm-svn: 357181
* Reworked all the utilities/meta tests to use ASSERT_SAME_TYPE instead of ↵Marshall Clow2019-03-2827-153/+120
| | | | | | 'static_assert( is_same<'. Much easier to read. I left two tests alone: is_same.pass.cpp, which should call 'is_same' directly, and common_type.pass.cpp, which Eric is working on. NFC intended llvm-svn: 357146
* [libc++] Rename span's as_writeable_bytes to as_writable_bytesLouis Dionne2019-03-284-58/+58
| | | | | | | | | | | | Summary: The Standard says as_writable_bytes. Reviewers: mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D59882 llvm-svn: 357139
OpenPOWER on IntegriCloud