summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
...
* [libc++][test] <=> now has a feature-test macroCasey Carter2019-10-131-3/+2
| | | | | | ...which `test/support/test_macros.h` can use to detect compiler support. llvm-svn: 374722
* [libc++][test] Silence MSVC warning in std::optional testCasey Carter2019-10-121-1/+1
| | | | | | `make_optional<string>(4, 'X')` passes `4` (an `int`) as the first argument to `string`'s `(size_t, charT)` constructor, triggering a signed/unsigned mismatch warning when compiling with MSVC at `/W4`. The incredibly simple fix is to instead use an unsigned literal (`4u`). llvm-svn: 374684
* [libc++] Fix linker script generationPetr Hosek2019-10-111-1/+3
| | | | | | | | | | Handle the case when libc++abi and libunwind are being built together with libc++ in the runtimes build. This logic was used in the previous implementation but dropped in r374116. Differential Revision: https://reviews.llvm.org/D68791 llvm-svn: 374510
* [libc++][test] Change IsSmallObject's calculation for std::any's small ↵Casey Carter2019-10-101-1/+1
| | | | | | | | | | object buffer `sizeof(std::any) - sizeof(void*)` is correct for both libc++ and the MSVC standard library. Differential Revision: https://reviews.llvm.org/D68756 llvm-svn: 374407
* [libc++][test] Miscellaneous MSVC cleanupsCasey Carter2019-10-098-71/+71
| | | | | | | | | | | | * Silence unused-local-typedef warnings: `map.cons/assign_initializer_list.pass.cpp` (and the `set.cons` variant) uses a local typedef only within `LIBCPP_ASSERT`s, so clang diagnoses it as unused when testing non-libc++. * Add missing include: `c.math/abs.pass.cpp` uses `std::numeric_limits` but failed to `#include <limits>`. * Don't test non-type: A "recent" change to `meta.trans.other/underlying_type.pass.cpp` unconditionally tests the type `F` which is conditionally defined. * Use `hash<long long>` instead of `hash<short>` with `int` in `unordered_meow` deduction guide tests to avoid truncation warnings. * Convert `3.14` explicitly in `midpoint.float.pass` since MSVC incorrectly diagnoses `float meow = 3.14;` as truncating. Differential Revision: https://reviews.llvm.org/D68681 llvm-svn: 374248
* Optimize operator=(const basic_string&) for tail call.Eric Fiselier2019-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Martijn Vels (mvels@google.com) Reviewed as https://reviews.llvm.org/D68276 This is a non trivial win for externally templated assignment operator. x86 without tail call (current libc++) 0000000000000000 <std::string::operator=(std::string const&)>: 0: 55 push %rbp 1: 48 89 e5 mov %rsp,%rbp 4: 53 push %rbx 5: 50 push %rax 6: 48 89 fb mov %rdi,%rbx 9: 48 39 f7 cmp %rsi,%rdi c: 74 17 je 25 <std::string::operator=(std::string const&)+0x25> e: 0f b6 56 17 movzbl 0x17(%rsi),%edx 12: 84 d2 test %dl,%dl 14: 79 07 jns 1d <std::string::operator=(std::string const&)+0x1d> 16: 48 8b 56 08 mov 0x8(%rsi),%rdx 1a: 48 8b 36 mov (%rsi),%rsi 1d: 48 89 df mov %rbx,%rdi 20: e8 00 00 00 00 callq 25 <std::string::operator=(std::string const&)+0x25> 25: 48 89 d8 mov %rbx,%rax 28: 48 83 c4 08 add $0x8,%rsp 2c: 5b pop %rbx 2d: 5d pop %rbp 2e: c3 retq After: 0000000000000000 <std::string::operator=(std::string const&)>: 0: 48 39 f7 cmp %rsi,%rdi 3: 74 14 je 19 <std::string::operator=(std::string const&)+0x19> 5: 0f b6 56 17 movzbl 0x17(%rsi),%edx 9: 84 d2 test %dl,%dl b: 79 07 jns 14 <std::string::operator=(std::string const&)+0x14> d: 48 8b 56 08 mov 0x8(%rsi),%rdx 11: 48 8b 36 mov (%rsi),%rsi 14: e9 00 00 00 00 jmpq 19 <std::string::operator=(std::string const&)+0x19> 19: 48 89 f8 mov %rdi,%rax 1c: c3 retq Benchmark (pending per https://reviews.llvm.org/D67667) ``` BM_StringAssignStr_Empty_Opaque 6.23ns ± 0% 5.19ns ± 0% -16.70% (p=0.016 n=5+4) BM_StringAssignStr_Empty_Transparent 5.86ns ± 0% 5.14ns ± 0% -12.24% (p=0.008 n=5+5) BM_StringAssignStr_Small_Opaque 8.79ns ± 1% 7.69ns ± 0% -12.53% (p=0.008 n=5+5) BM_StringAssignStr_Small_Transparent 9.44ns ± 0% 8.00ns ± 0% -15.26% (p=0.008 n=5+5) BM_StringAssignStr_Large_Opaque 25.2ns ± 0% 24.3ns ± 0% -3.50% (p=0.008 n=5+5) BM_StringAssignStr_Large_Transparent 23.6ns ± 0% 22.5ns ± 0% -4.76% (p=0.008 n=5+5) BM_StringAssignStr_Huge_Opaque 319ns ± 5% 317ns ± 5% ~ (p=0.690 n=5+5) BM_StringAssignStr_Huge_Transparent 319ns ± 5% 317ns ± 5% ~ (p=0.421 n=5+5) BM_StringAssignAsciiz_Empty_Opaque 7.41ns ± 0% 7.77ns ± 0% +4.89% (p=0.008 n=5+5) BM_StringAssignAsciiz_Empty_Transparent 7.54ns ± 3% 7.30ns ± 0% -3.24% (p=0.008 n=5+5) BM_StringAssignAsciiz_Small_Opaque 9.87ns ± 0% 10.24ns ± 1% +3.76% (p=0.008 n=5+5) BM_StringAssignAsciiz_Small_Transparent 10.4ns ± 1% 9.8ns ± 2% -5.78% (p=0.008 n=5+5) BM_StringAssignAsciiz_Large_Opaque 30.1ns ± 0% 30.1ns ± 0% ~ (p=0.167 n=5+5) BM_StringAssignAsciiz_Large_Transparent 27.1ns ± 0% 27.4ns ± 0% +0.92% (p=0.016 n=4+5) BM_StringAssignAsciiz_Huge_Opaque 383ns ± 4% 382ns ± 4% ~ (p=0.548 n=5+5) BM_StringAssignAsciiz_Huge_Transparent 375ns ± 0% 380ns ± 0% +1.37% (p=0.029 n=4+4) BM_StringAssignAsciizMix_Opaque 14.0ns ± 0% 14.0ns ± 0% ~ (p=0.881 n=5+5) BM_StringAssignAsciizMix_Transparent 13.7ns ± 1% 13.8ns ± 0% ~ (p=0.056 n=5+5) ``` llvm-svn: 374137
* [libc++] Workaround old versions of CMake that don't understand list(JOIN)Louis Dionne2019-10-081-1/+1
| | | | llvm-svn: 374120
* [libc++] Move the linker script generation step to CMakeLouis Dionne2019-10-084-92/+54
| | | | | | | | | | | | | | | | | | Summary: This allows the linker script generation to query CMake properties (specifically the dependencies of libc++.so) instead of having to carry these dependencies around manually in global variables. Notice the removal of the LIBCXX_INTERFACE_LIBRARIES global variable. Reviewers: phosek, EricWF Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D68343 llvm-svn: 374116
* [libc++] Make sure we link all system libraries into the benchmarksLouis Dionne2019-10-083-72/+64
| | | | | | | | | It turns out that r374056 broke _some_ build bots again, specifically the ones using sanitizers. Instead of trying to link the right system libraries to the benchmarks bit-by-bit, let's just link exactly the system libraries that libc++ itself needs. llvm-svn: 374079
* [libc++] TAKE 2: Make system libraries PRIVATE dependencies of libc++Louis Dionne2019-10-081-14/+14
| | | | | | | | | | We tried doing that previously (in r373487) and failed (reverted in r373506) because the benchmarks needed to link against system libraries and relied on libc++'s dependencies being propagated. Now that this has been fixed (in r374053), this commit marks the system libraries as PRIVATE dependencies of libc++. llvm-svn: 374056
* [libc++] Add missing link-time dependencies to the benchmarksLouis Dionne2019-10-081-0/+9
| | | | | | | | | | | | | | Since the benchmarks build with -nostdlib, they need to manually link against some system libraries that are used by the benchmarks and the GoogleBenchmark library itself. Previously, we'd rely on the fact that these libraries were linked through the PUBLIC dependencies of cxx_shared/cxx_static. However, if we were to make these dependencies PRIVATE (as they should be because they are implementation details of libc++), the benchmarks would fail to link. This commit remediates that. llvm-svn: 374053
* [libc++] Use PRIVATE to link benchmark dependenciesLouis Dionne2019-10-081-9/+9
| | | | | | | | It's better style to use PRIVATE when linking libraries to executables, and it doesn't make a difference since executables don't need to propagate their link-time dependencies anyway. llvm-svn: 374050
* [libc++] Remove C++03 variadics in shared_ptr (v2)Zoe Carver2019-10-071-70/+0
| | | | | | | | | | | | | | Summary: In my last patch (D67675) I forgot a few variadics. This patch removes the remaining make_shared and allocate_shared C++03 variadics. Reviewers: ldionne, EricWF, mclow.lists Subscribers: christof, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D68000 llvm-svn: 373971
* [libc++] Guard cxx_experimental settings behind ↵Alex Langford2019-10-041-6/+6
| | | | | | | | | | LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY If you explicitly set LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY to OFF, your project will fail to configure because the cxx_experimental target doesn't exist. llvm-svn: 373809
* [libc++] Localize common build flags into a single CMake functionLouis Dionne2019-10-042-20/+21
| | | | | | | | Also, set those flags for the cxx_experimental target. Otherwise, cxx_experimental doesn't build properly when neither the static nor the shared library is compiled (yes, that is a weird setup). llvm-svn: 373808
* Add an off-by-default option to enable testing for gdb pretty printers.Sterling Augustine2019-10-042-6/+11
| | | | | | | | | | | | | | | | Summary: The current version of the pretty printers are not python3 compatible, so turn them off by default until sufficiently improved. Reviewers: MaskRay, tamur Subscribers: mgorny, christof, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68477 llvm-svn: 373796
* [libc++] Make the modules-related flags PUBLIC instead of PRIVATELouis Dionne2019-10-041-2/+2
| | | | | | | It appears that those need to be propagated to targets that use libc++ as well, otherwise they don't build properly. llvm-svn: 373773
* [libc++] Move more CMake flags to per-target definitionsLouis Dionne2019-10-042-19/+31
| | | | | | | This daily refactoring tackles flags related to modules, exceptions and RTTI. llvm-svn: 373767
* Make libc++ gdb pretty printer Python 3 compatibleFangrui Song2019-10-042-10/+27
| | | | llvm-svn: 373691
* Attempt to remove linker workaround on the buildbots: Attempt 2Eric Fiselier2019-10-031-7/+0
| | | | | | | | | | | | The first commit removed the workaround in a old script. This patch removes it in the file actually used by the bots. I have no idea if this is still needed, but removing the workaround seems like the easiest way to test. I'll revert this change if the bots go red. llvm-svn: 373653
* Attempt to remove linker workaround on the buildbots.Eric Fiselier2019-10-031-7/+0
| | | | | | | | | I have no idea if this is still needed, but removing the workaround seems like the easiest way to test. I'll revert this change if the bots go red. llvm-svn: 373650
* [libc++] Add a per-target flag to include the generated config_siteLouis Dionne2019-10-033-16/+14
| | | | | | | | | | | This allows propagating the include automatically to targets that depend on one of the libc++ targets such as the benchmarks. Note that the GoogleBenchmark build itself still needs to manually specify the -include, since I don't know of any way to have an external project link against one of the libc++ targets (which would propagate the -include automatically). llvm-svn: 373631
* [libc++] Add missing revision number in ABI changelogLouis Dionne2019-10-031-1/+1
| | | | llvm-svn: 373625
* Fix libc++ pretty printer test for Python 3 after D67238 (take 2)Fangrui Song2019-10-031-3/+1
| | | | | | | | In both Python 2 and Python 3, gdb.Value.string returns a 'str'. We just need to delete a `encode("utf-8")` which would return a 'bytes' in Python 3. llvm-svn: 373570
* [libc++] Use functions instead of global variables to set libc++ build flagsLouis Dionne2019-10-022-67/+77
| | | | | | | | This commit follows the trend of doing things per-target instead of modifying the C++ flags globally. It does so for visibility-related flags, other basic build flags and Windows-specific flags. llvm-svn: 373517
* [libc++] Use a function to set warning flags per targetLouis Dionne2019-10-022-32/+35
| | | | | | | | | | This is part of a larger shift to move to per-target settings and eradicate global variables from the CMake build. I'm starting small with warnings only because those are easy to transition over and I want to see how it pans out, but we can handle all flags like exceptions and RTTI in the future. llvm-svn: 373511
* [libc++] Revert to using PUBLIC instead of PRIVATE when linking system libsLouis Dionne2019-10-021-14/+14
| | | | | | | | It turns out the benchmarks need to link against those libraries explicitly too, so CMake's propagation of PUBLIC dependencies is used. llvm-svn: 373506
* [libc++] Use PRIVATE instead of PUBLIC when linking against system libsLouis Dionne2019-10-021-14/+14
| | | | llvm-svn: 373487
* Fix libc++ pretty printer test for Python 3 after D67238Fangrui Song2019-10-021-1/+1
| | | | llvm-svn: 373452
* Determine endianness at a time when it doesn't inadvertantly clear gdb's ↵Sterling Augustine2019-10-011-7/+11
| | | | | | | | | | | | | | | | | | wrap_buffer via gdb.execute. Summary: I haven't managed a small reproduction for this bug, it involves complicated and deeply nested data structures with a wide variety of pretty printers. But in general, we shouldn't be combining gdb's command line interface (via gdb.execute) with pretty-printers. Subscribers: christof, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68306 llvm-svn: 373402
* [NFC] Fix typos in libc++ documentationLouis Dionne2019-10-011-3/+3
| | | | llvm-svn: 373390
* [libc++] Re-apply workaround for D63883Louis Dionne2019-10-011-0/+10
| | | | | | | | | In reality, this workaround is for the fact that LIBCXX_CXX_ABI=libcxxabi can't be specified on Linux, since libc++abi isn't shipped with the system. Since the build bots explicitly specify LIBCXX_CXX_ABI=libcxxabi, they fail unless we apply the workaround. llvm-svn: 373385
* [libc++] Remove workaround for D63883Louis Dionne2019-10-011-10/+0
| | | | | | | | | | I tried applying D63883 three times and could never get around to making it work. I'm giving up on that for now, but soon this should be irrelevant anyway since all builds will move to the monorepo (where we're always using the in-tree libc++abi unless explicitly specified otherwise). llvm-svn: 373384
* [libc++] Harden usage of static_assert against C++03Louis Dionne2019-10-011-2/+2
| | | | | | | In C++03, we emulate static_assert with a macro, and we must parenthesize multiple arguments. llvm-svn: 373328
* Refactor default constructor SFINAE in pair and tuple.Eric Fiselier2019-09-303-44/+29
| | | | | | | Refactor the recent implicit default constructor changes to match the existing SFINAE style. llvm-svn: 373263
* [libc++] Take 2: Implement LWG 3158Louis Dionne2019-09-275-17/+65
| | | | | | | | | | | | | | | | | | | | | Summary: LWG 3158 marks the allocator_arg_t constructor of std::tuple as conditionnally explicit based on whether the default constructors of the tuple's members are explicitly default constructible. This was previously committed as r372778 and reverted in r372832 due to the commit breaking LLVM's build in C++14 mode. This issue has now been addressed. Reviewers: mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D65232 llvm-svn: 373092
* [libc++] Take 2: Implement LWG 2510Louis Dionne2019-09-2624-39/+459
| | | | | | | | | | | | | | | | | | | | | | | Summary: LWG2510 makes tag types like allocator_arg_t explicitly default constructible instead of implicitly default constructible. It also makes the constructors for std::pair and std::tuple conditionally explicit based on the explicit-ness of the default constructibility for the pair/tuple's elements. This was previously committed as r372777 and reverted in r372832 due to the commit breaking LLVM's build in C++14 mode. This issue has now been addressed. Reviewers: mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D65161 llvm-svn: 372983
* [libcxx] Do not implicitly #include assert.hDavid Zarzycki2019-09-268-4/+178
| | | | | | | | | Users should only get the assert() macros if they explicitly include them. Found after switching from the GNU C++ stdlib to the LLVM C++ stdlib. llvm-svn: 372963
* [libc++] Purge mentions of GCC 4 from the test suiteLouis Dionne2019-09-2525-59/+6
| | | | | | | | | We don't support GCC 4 and older according to the documentation, so we should pretend it doesn't exist. This is a re-application of r372787. llvm-svn: 372916
* Add forward declaration of operator<< in <string_view> as required.Eric Fiselier2019-09-253-1/+34
| | | | | | | | This declaration was previously missing despite appearing in the synopsis. Users are still required to include <ostream> to get the definition of the streaming operator. llvm-svn: 372909
* add tests that debug mode catches nullptr->string_view conversions in ↵Eric Fiselier2019-09-251-0/+5
| | | | | | comparison operators llvm-svn: 372907
* Add a missing default parameter to regex::assign. This is LWG3296; reviewed ↵Marshall Clow2019-09-252-6/+16
| | | | | | as https://reviews.llvm.org/D67944 llvm-svn: 372896
* Revert r372777: [libc++] Implement LWG 2510 and its follow-upsIlya Biryukov2019-09-2552-475/+105
| | | | | | | | | | | | This also reverts: - r372778: [libc++] Implement LWG 3158 - r372782: [libc++] Try fixing tests that fail on GCC 5 and older - r372787: Purge mentions of GCC 4 from the test suite Reason: the change breaks compilation of LLVM with libc++, for details see http://lists.llvm.org/pipermail/libcxx-dev/2019-September/000599.html llvm-svn: 372832
* [libc++] Purge mentions of GCC 4 from the test suiteLouis Dionne2019-09-2432-66/+13
| | | | | | | We don't support GCC 4 and older according to the documentation, so we should pretend it doesn't exist. llvm-svn: 372787
* [libc++] Try fixing tests that fail on GCC 5 and olderLouis Dionne2019-09-247-1/+27
| | | | llvm-svn: 372782
* [libc++] Remove C++03 variadics in shared_ptrZoe Carver2019-09-244-323/+80
| | | | | | | | | | | | | | Summary: As suggested by @ldionne in D66178, this patch removes C++03 variadics //only//. Following patches will apply more updates. Reviewers: ldionne, EricWF, mclow.lists Subscribers: christof, dexonsmith, libcxx-commits, ldionne Tags: #libc Differential Revision: https://reviews.llvm.org/D67675 llvm-svn: 372780
* [libc++] Implement LWG 3158Louis Dionne2019-09-245-17/+65
| | | | | | | | | | | | | | | | | Summary: LWG 3158 marks the allocator_arg_t constructor of std::tuple as conditionnally explicit based on whether the default constructors of the tuple's members are explicitly default constructible. Reviewers: EricWF, mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D65232 llvm-svn: 372778
* [libc++] Implement LWG 2510Louis Dionne2019-09-2424-38/+387
| | | | | | | | | | | | | | | | | | | Summary: LWG2510 makes tag types like allocator_arg_t explicitly default constructible instead of implicitly default constructible. It also makes the constructors for std::pair and std::tuple conditionally explicit based on the explicit-ness of the default constructibility for the pair/tuple's elements. Reviewers: mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D65161 llvm-svn: 372777
* [libc++] Mark CTAD tests as not failing on AppleClang 10.0.1Louis Dionne2019-09-238-8/+8
| | | | | | They do fail on AppleClang 10.0.0, but not AppleClang 10.0.1 llvm-svn: 372632
* [libc++] Mark iostreams test as XFAIL on older macOSesLouis Dionne2019-09-231-0/+12
| | | | llvm-svn: 372620
OpenPOWER on IntegriCloud