summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
...
* Mark vector::operator[] and front/back as noexcept. We already do this for ↵Marshall Clow2019-03-153-8/+130
| | | | | | string and string_view. This should give better codegen inside of noexcept functions. Add tests for op[]/front/back/at, because apparently we had none. llvm-svn: 356224
* XFAIL this debug-mode test that I just broke. Eric has a patch out for ↵Marshall Clow2019-03-141-1/+1
| | | | | | review (D59166) that rewrites this test completely, so I'm not going to bother fixing it. llvm-svn: 356211
* Add noexcept to operator[] for array and deque. This is an extension. We ↵Marshall Clow2019-03-144-12/+37
| | | | | | already do this for string and string_view. This should give better codegen inside of noexcept functions. llvm-svn: 356209
* Reorg the midpoint pointer test into runtime and constexpr tests; comment ↵Marshall Clow2019-03-141-10/+40
| | | | | | out the volatile constexpr tests for GCC because our experimental gcc bot barfs on them. llvm-svn: 356177
* Fix two of the three bot failures for midpoint; the ones regarding the lack ↵Marshall Clow2019-03-142-2/+8
| | | | | | of '__int128_t' llvm-svn: 356169
* [libc++][CMake] Do not define `cxx_shared_EXPORTS` when building the shared ↵Louis Dionne2019-03-141-0/+1
| | | | | | | | | | | | library CMake will define -Dcxx_shared_EXPORTS when building the shared library by default. In theory, this is used to signal to the library that we're building a shared library and that dllimport/dllexport should be used. However, we already have our own way of doing that, so I'm removing this define to avoid meaningless command line arguments in the build. llvm-svn: 356167
* Add std::midpoint for integral and poiner types. Described in P0811, ↵Marshall Clow2019-03-145-0/+322
| | | | | | reviewed as D59099. llvm-svn: 356162
* [libc++][CMake] Fix typo introduced in r356150Louis Dionne2019-03-141-1/+1
| | | | | | That typo broke the build when the shared library build was disabled. llvm-svn: 356155
* [libc++] Do not force building with -fPIC (re-applying)Louis Dionne2019-03-141-4/+0
| | | | | | | | | | | | | | | | | | | | | | | Summary: In r355746, we stopped forcing to build with -fPIC because that should be specified by the CMAKE_POSITION_INDEPENDENT_CODE option at CMake configure time (and by default -fPIC is used for shared libraries anyways). However, r355746 had to be reverted in r355756 because we were not actually building the shared library with -fPIC. The reason is that we were sharing an object library between the static and the shared library, which caused flags for static libraries to be used when building object files that were going to be used for a shared library. Since this was resolved by r356150, we can stop forcing -fPIC again. Reviewers: EricWF, smeenai Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D59250 llvm-svn: 356153
* [libc++] Do not share an object library to create the static/shared librariesLouis Dionne2019-03-141-38/+19
| | | | | | | | | | | | | | | | | | | | | | Summary: The problem with using an object library for doing this is that it prevents the shared library and the static library from being built with the right default flags. For example, CMake will build shared libraries with -fPIC by default, but not static libraries. Using an object library to create the shared library will prevent the right default flags for shared libraries from being used. As a side effect, this patch also localizes the logic related to building a hermetic static library to the static library case, making clear that this has no effect on the shared library. Reviewers: phosek, EricWF Subscribers: mgorny, christof, jkorous, dexonsmith, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D59248 llvm-svn: 356150
* Properly constrain basic_string(Iter, Iter, Alloc = A())Eric Fiselier2019-03-142-4/+13
| | | | llvm-svn: 356140
* [libc++] Enable deprecation warnings by defaultLouis Dionne2019-03-1287-38/+157
| | | | | | | | | | | | | | | | | | | Summary: In r342843, I added deprecation warnings to some facilities that were deprectated in C++14 and C++17. However, those deprecation warnings were not enabled by default. After discussing this on IRC, we had finally gotten consensus to enable those warnings by default, and I'm getting around to doing that only now. Reviewers: mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D58140 llvm-svn: 355961
* Allow optional to tolerate being used with a nested class.Eric Fiselier2019-03-112-3/+48
| | | | | | | | | | | | | | | When Clang tries to complete a type containing `std::optional` it considers the `in_place_t` constructor with no arguments which checks if the value type is default constructible. If the value type is a nested class type, then this check occurs too early and poisons the is_default_constructible trait. This patch makes optional deduce `in_place_t` so we can prevent this early SFINAE evaluation. Technically this could break people doing weird things with the in_place_t tag, but that seems less important than making the nested class case work. llvm-svn: 355877
* [libc++] Remove empty header xlocale/xlocale.hLouis Dionne2019-03-112-1/+0
| | | | | | | | | | | | | | Summary: I can't think of a reason for shipping this empty header. If there is a reason to do so, then hopefully this review can uncover it. Reviewers: mclow.lists, EricWF Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D59137 llvm-svn: 355829
* LWG 2843 "Unclear behavior of std::pmr::memory_resource::do_allocate()"Eric Fiselier2019-03-092-11/+15
| | | | | | | | | | | | | | | | | | | | Patch by Arthur O'Dwyer. Reviewed as https://reviews.llvm.org/D47344 new_delete_resource().allocate(n, a) has basically two permissible results: * Return an appropriately sized and aligned block. * Throw bad_alloc. Before this patch, libc++'s new_delete_resource would do a third and impermissible thing, which was to return an appropriately sized but inappropriately under-aligned block. This is now fixed. (This came up while I was stress-testing unsynchronized_pool_resource on my MacBook. If we can't trust the default resource to return appropriately aligned blocks, pretty much everything breaks. For similar reasons, I would strongly support just patching __libcpp_allocate directly, but I don't care to die on that hill, so I made this patch as a <memory_resource>-specific workaround.) llvm-svn: 355763
* Work around dllimport bug with exclude_from_explicit_instantiation.Eric Fiselier2019-03-081-0/+3
| | | | | | | | | | | | When dllimport is specified on a class, and exclude_from_explicit_instatiation is specified on a member, clang-cl will still expect a definition to be available externally. But this is not correct. Surprisingly one one symbol seems to be consistently affected by this bug. So this patch simply works around it there. llvm-svn: 355760
* Fix C++03 build failureEric Fiselier2019-03-081-1/+1
| | | | llvm-svn: 355758
* Revert "[libc++] Do not force building with -fPIC"Eric Fiselier2019-03-081-0/+4
| | | | | | | | | | This reverts commit r355764. CMake does not turn -fPIC on for us by default. so this patch breaks standalone builds. The only reason it hasn't broken any bots is because LLVM turns on and specifies '-fPIC' for us. llvm-svn: 355756
* Unbork `std::memory_order` ABI.Eric Fiselier2019-03-081-6/+29
| | | | | | | | | | | | | | | | | | | Summary: We need to pin the underlying type of C++20' `std::memory_order` to match the C++17 version. Anything less is an ABI break. At the moment it's `unsigned` before C++20 and `int` after. Or if you're using `-fshort-enums` it's `unsigned char` before C++20 and `int` after. This patch explicitly specifies the underlying type of the C++20 `memory_order` to be w/e type the compiler would have chosen for the C++17 version. Reviewers: mclow.lists, ldionne Reviewed By: ldionne Subscribers: jfb, jdoerfert, #libc, zoecarver Differential Revision: https://reviews.llvm.org/D59063 llvm-svn: 355755
* Fix PR41017 - Build failure with _LIBCPP_DEBUG=0 and non-const-refEric Fiselier2019-03-082-7/+32
| | | | | | | | | | | comparator for std::sort() Our debug comparator assumed that the comparator it wraps would always accepts the values by const ref. This isn't required by the standard. This patch makes our __debug_less comparator forward the constness. llvm-svn: 355752
* [libc++] Do not force building with -fPICLouis Dionne2019-03-081-4/+0
| | | | | | | | | | | | | | | | Summary: Whether we build with -fPIC should be specified by the CMAKE_POSITION_INDEPENDENT_CODE option at configure time. Note that this patch doesn't change the behavior when building by default, since -fPIC is used for shared libraries by default. Reviewers: EricWF Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D59146 llvm-svn: 355746
* [NFC] Add missing revision information to ABI ChangelogLouis Dionne2019-03-081-1/+1
| | | | llvm-svn: 355732
* Revert "[runtimes] Move libunwind, libc++abi and libc++ to lib/ and include/"Matthew Voss2019-03-082-14/+12
| | | | | | | | This broke the windows bots. This reverts commit 28302c66d2586074f77497d5dc4eac7182b679e0. llvm-svn: 355725
* [runtimes] Move libunwind, libc++abi and libc++ to lib/ and include/Petr Hosek2019-03-082-12/+14
| | | | | | | | | | | | | | | This change is a consequence of the discussion in "RFC: Place libs in Clang-dedicated directories", specifically the suggestion that libunwind, libc++abi and libc++ shouldn't be using Clang resource directory. Tools like clangd make this assumption, but this is currently not true for the LLVM_ENABLE_PER_TARGET_RUNTIME_DIR build. This change addresses that by moving the output of these libraries to lib/<target> and include/ directories, leaving resource directory only for compiler-rt runtimes and Clang builtin headers. Differential Revision: https://reviews.llvm.org/D59013 llvm-svn: 355665
* [libc++] Fix use-after-free when building with _LIBCPP_DEBUG=1Thomas Anderson2019-03-062-41/+53
| | | | | | | | | | | | | | | | | | | | | | | The issue is the following code: __cn1->__add(*__ip); (*__ip)->__c_ = __cn1; `__ip` points into the array of iterators for container `__cn2`. This code adds the iterator to the array of iterators for `__cn1`, and updates the iterator to point to the new container. This code works fine, except when `__cn1` and `__cn2` are the same container. `__cn1->__add()` might need to grow the array of iterators, and when it does, `__ip` becomes invalid, so the second line becomes a use-after-free error. Simply swapping the order of the above two lines is not sufficient, because of the memmove() below. The easiest and most performant solution is just to skip touching any iterators if the containers are the same. Differential Revision: https://reviews.llvm.org/D58926 llvm-svn: 355550
* Fix ABI compatibility of `<stdexcept>` with VCRuntime.Eric Fiselier2019-03-064-82/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently, libc++'s `<stdexcept>` doesn't play nice with `vcruntime`. Specifically: * `logic_error` and `runtime_error` have a different layout. * libc++'s `logic_error` and `runtime_error` override `what()` but `vcruntime` does not. * `vcruntime` uses weak vtables for `<stdexcept>` types. * libc++'s `<stdexcept>` constructors and assignment operators may have different manglings than `vcruntimes`. This patch makes libc++'s declarations in `<stdexcept>` match those provided by MSVC's STL as closely as possible. If MSVC doesn't declare a special member, then neither do we. This ensures that the implicit definitions have the same linkage, visibility, triviality, and noexcept-ness. Reviewers: thomasanderson, ldionne, smeenai Reviewed By: thomasanderson Subscribers: jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D58945 llvm-svn: 355546
* [libc++] Do not specify the underlying type of memory_orderLouis Dionne2019-03-061-8/+2
| | | | | | | | | | | | | | | | Summary: This breaks ABI for folks using -fshort-enums, and does not really buy us anything. http://llvm.org/PR40977 Reviewers: mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits, zoecarver Differential Revision: https://reviews.llvm.org/D59029 llvm-svn: 355521
* Eradicate all the ptrdiff_ts in span left over from applying P1227. A couple ↵Marshall Clow2019-03-0612-67/+66
| | | | | | of other minor cleanups. NFC llvm-svn: 355481
* [libc++] Only add dylib-related features when using the system's libc++Louis Dionne2019-03-051-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise, when testing trunk libc++ on an older system, lit will think that the dylib features are disabled. Ideally, we'd have a notion of running the tests with/without a deployment target (or, equivalently, a deployment target representing trunk where everything is as recent as can be). Since we always have a deployment target right now (which defaults to the current system), we only enable those features when we're going to also be testing with the system libc++. We also need to disable the availability markup when we are not running a system library flavor, because availability markup does not make sense when building against the trunk libc++ (which has everything regardless of what the current system is). This is a re-application of r353319, which had been reverted due to CI breakage. This time around, I made sure it didn't break our internal CI before submitting. This is also a partial undoing of r348296, in spirit at least. However, with this patch, availability markup is enabled based on whether we're using a system library or not, whereas previously one could enable it or disable it arbitrarily. This was confusing as it led to testing configurations that don't make sense (such as testing a system library without availability markup, or trunk testing with availability markup). llvm-svn: 355451
* Reinstate libc++ patches now that the lldb formatter has been updated.Davide Italiano2019-03-056-281/+856
| | | | | | | | "[libc++] Fix <atomic> failures on GCC" "[libc++] Change memory_order to an enum class" "[libc++] decoupling Freestanding atomic<T> from libatomic.a" llvm-svn: 355427
* [libcxx] Revert set of atomic patches that broke lldb.Davide Italiano2019-03-056-856/+281
| | | | | | | | | | | Revert "[libc++] Fix <atomic> failures on GCC" Revert "[libc++] Change memory_order to an enum class" Revert "[libc++] decoupling Freestanding atomic<T> from libatomic.a" The lldb formatter nededs to be updated. Shafik and Louis will coordinate to do so. llvm-svn: 355417
* [libc++] Fix <atomic> failures on GCCLouis Dionne2019-03-052-103/+103
| | | | | | | | | | | | | | | | Summary: In https://reviews.llvm.org/D58201, we turned memory_order into an enum class in C++20 mode. However, we were not casting memory_order to its underlying type correctly for the GCC implementation, which broke the build bots. I also fixed a test that was failing in C++17 mode on GCC 5. Reviewers: EricWF, jfb, mclow.lists Subscribers: zoecarver Differential Revision: https://reviews.llvm.org/D58966 llvm-svn: 355409
* [libc++] Change memory_order to an enum classLouis Dionne2019-03-054-59/+115
| | | | | | | | | This implements P0439R0. Thanks to Zoe Carver for the patch. Differential Revision: https://reviews.llvm.org/D58201 llvm-svn: 355403
* Fix -fsanitize=vptr badness in <__debug>Eric Fiselier2019-03-058-16/+52
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes a lifetime bug when inserting a new container into the debug database. It is diagnosed by UBSAN when debug mode is enabled. This patch corrects how nodes are constructed during insertion. The fix requires unconditionally breaking the debug mode ABI. Users should not expect ABI stability from debug mode. Reviewers: ldionne, serge-sans-paille, EricWF Reviewed By: EricWF Subscribers: mclow.lists, christof, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D58011 llvm-svn: 355367
* Make VCRuntime ABI configuration a first-class option.Eric Fiselier2019-03-058-24/+24
| | | | | | | | | | | | | | | | | | | | | | | Summary: On Windows we currently provide two separate ABI configurations. One which defers to `vcruntime` to provide the C++ runtime and another which doesn't. Using `vcruntime` allows interoperability which programs compiled against the MSVC STL, and should be preferred whenever possible. When deferring to `vcruntime` much of the ABI we provide changes. Including the layout of `<stdexcept>` types, their vtables, and how the linkage of their members. This patch introduces the `_LIBCPP_ABI_VCRUNTIME` macro to denote this configuration. It also cleans up the existing configuration for using `vcruntime`. This cleanup lays the groundwork for fixing a number of ABI and interoperability bugs in `<stdexcept>`. Reviewers: thomasanderson, ldionne, smeenai Reviewed By: smeenai Subscribers: jdoerfert, libcxx-commits, #libc Differential Revision: https://reviews.llvm.org/D58942 llvm-svn: 355366
* [libc++] Remove old CMake workaroundLouis Dionne2019-03-041-20/+14
| | | | | | | We haven't had any complaints so far, and I don't think anybody builds libc++ from source for that old platform anymore. llvm-svn: 355336
* Install GCC 5 on buildbots to replace GCC 4.9.Eric Fiselier2019-03-041-3/+3
| | | | | | | | | | | LLVM is dropping support for GCC 4.9. This patch adds a GCC 5 installation to the buildbot image so we can upgrade the 4.9 bot to GCC 5. As a temporary workaround until zorg updates, we install GCC 5 as GCC 4.9. llvm-svn: 355334
* [libc++] decoupling Freestanding atomic<T> from libatomic.aLouis Dionne2019-03-042-240/+759
| | | | | | | | | | | This patch introduces non-lockfree atomics that do not require using an external libatomic. This work is done with the long-term goal of allowing the use of <atomic> in freestanding environments. Thanks to Olivier Giroux for the patch. Differential Revision: https://reviews.llvm.org/D56913 llvm-svn: 355318
* [libc++] Fix forgotten fclose() in unit testLouis Dionne2019-03-011-0/+1
| | | | | | | Thanks to Andrey Maksimov for the patch. Differential Revision: https://reviews.llvm.org/D58732 llvm-svn: 355162
* [libc++] Increase portability of xalloc testLouis Dionne2019-03-011-5/+3
| | | | | | | | | | Do not assume that xalloc() starts at 0, which is not specified by the Standard. Thanks to Andrey Maksimov for the patch. Differential Revision: https://reviews.llvm.org/D58299 llvm-svn: 355160
* [NFC][libc++] Update comment about oldest supported macosx for back-deploymentLouis Dionne2019-02-271-1/+1
| | | | llvm-svn: 355043
* [libc++] Add is_nothrow_convertible from P0758R1Louis Dionne2019-02-273-1/+88
| | | | | | | Reviewed as https://reviews.llvm.org/D58019. Thanks to Zoe Carver for the patch. llvm-svn: 355010
* [libc++] Remove visibility-related warnings with Clang 8Louis Dionne2019-02-272-8/+4
| | | | | | | The attributes were placed incorrectly -- they need to be after the "struct" keyword, not before. llvm-svn: 355006
* I changed a 'enable_if<...>::type to' 'enable_if_t<...>' but forgot to ↵Marshall Clow2019-02-271-1/+1
| | | | | | remove the preceding 'typename' llvm-svn: 354995
* Implment the last part of P1024: tuple-like interface to span. Reviewed as ↵Marshall Clow2019-02-278-11/+291
| | | | | | https://reviews.llvm.org/D58706. llvm-svn: 354988
* In the review of D58642, Louis asked: 'Is there a reason for making this ↵Marshall Clow2019-02-271-33/+33
| | | | | | inline? Templates are already inline by default'. I told him that I didn't want to change the one call (ssize) that I was adding, but would come back later and clean them all (data/empty/begin/end/cbegin/cend/rbegin/rend/crbegin/crend/size/ssize) up later. Now it is later. Remove the unnecessary 'inline' modifiers from all these calls. llvm-svn: 354952
* Implement the second part of P1227R2 - Signed ssize() functions. Reviewed as ↵Marshall Clow2019-02-273-10/+146
| | | | | | https://reviews.llvm.org/D58642 llvm-svn: 354950
* Fix an ambiguity in the tests that gcc-tot complained about.Marshall Clow2019-02-2711-22/+22
| | | | llvm-svn: 354944
* [libc++] Add a test for PR14074Louis Dionne2019-02-271-0/+62
| | | | | | PR14074 was fixed in r165884, but no tests were added. llvm-svn: 354943
* [libc++] Mark several tests as XFAIL on macosx10.7Louis Dionne2019-02-2736-0/+179
| | | | | | | | | | | | | | | Those tests fail when linking against a new dylib but running against macosx10.7. I believe this is caused by a duplicate definition of the RTTI for exception classes in libc++.dylib and libc++abi.dylib, but this matter still needs some investigation. This issue was not caught previously because all the tests always linked against the same dylib used for running (because LIT made it impossible to do otherwise before r349171). rdar://problem/46809586 llvm-svn: 354940
OpenPOWER on IntegriCloud