summaryrefslogtreecommitdiffstats
path: root/libcxx/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix UB - signed integer overflow in regex. Thanks to Tim Shen for the patch. ↵Marshall Clow2017-10-191-0/+2
| | | | | | Reviewed as https://reviews.llvm.org/D39066 llvm-svn: 316172
* Fix regex bug with ^\W. Thanks to Tim Shen for the patch. Reviewed as ↵Marshall Clow2017-10-181-12/+18
| | | | | | https://reviews.llvm.org/D37955 llvm-svn: 316095
* Refactor std::list node allocation logic.Eric Fiselier2017-10-171-33/+23
| | | | | | | | | | | | The logic to allocate a node within std::list was repeated in a bunch of places. This is unneeded. This patch refactors the shared logic into a single function to reduce duplication. This patch is part of a set to clean up node construction in general, but refactoring construction requires some more work to make it work cleanly in C++03 llvm-svn: 316021
* Refactor _LIBCPP_<LITTLE|BIG>_ENDIANEric Fiselier2017-10-172-35/+22
| | | | | | | | | | Previously this macro used 0/1 to indicate if it was set. This is unlike all other libc++ configuration macros which use ifdef/ifndef. This patch makes this macro consistent with everything else. llvm-svn: 315995
* [libc++] Fix PR34898 - vector iterator constructors and assign method ↵Eric Fiselier2017-10-173-6/+29
| | | | | | | | | | | | | | | | | | | | | | | perform push_back instead of emplace_back. Summary: The constructors `vector(Iter, Iter, Alloc = Alloc{})` and `assign(Iter, Iter)` don't correctly perform EmplaceConstruction from the result of dereferencing the iterator. This results in them performing an additional and unneeded copy. This patch addresses the issue by correctly using `emplace_back` in C++11 and newer. There are also some bugs in our `insert` implementation, but those will be handled separately. @mclow.lists We should probably merge this into 5.1, agreed? Reviewers: mclow.lists, dlj, EricWF Reviewed By: mclow.lists, EricWF Subscribers: cfe-commits, mclow.lists Differential Revision: https://reviews.llvm.org/D38757 llvm-svn: 315994
* [libc++] Support Microsoft ABI without vcruntime headersShoaib Meenai2017-10-093-8/+9
| | | | | | | | | | | | | | | | | The vcruntime headers are hairy and clash with both libc++ headers themselves and other libraries. libc++ normally deals with the clashes by deferring to the vcruntime headers and silencing its own definitions, but for clients which don't want to depend on vcruntime headers, it's desirable to support the opposite, i.e. have libc++ provide its own definitions. Certain operator new/delete replacement scenarios are not currently supported in this mode, which requires some tests to be marked XFAIL. The added documentation has more details. Differential Revision: https://reviews.llvm.org/D38522 llvm-svn: 315234
* [libc++] Clarify names of ABI forcing macrosShoaib Meenai2017-10-052-3/+9
| | | | | | | | | Make it clear that these are intended only to force a specific ABI when the autodetection would give the wrong result by renaming the cmake options and adding separate forcing macros, as suggested by EricWF in the post-commit review of r314949 and further discussed on IRC. llvm-svn: 314965
* [libc++] Allow users to explicitly specify ABIShoaib Meenai2017-10-042-5/+11
| | | | | | | | | | libc++'s current heuristic for detecting Itanium vs. Microsoft ABI falls short in some cases. For example, it will detect windows-itanium targets as using the Microsoft ABI, since they set `_MSC_VER` (for compatibility with Microsoft headers). Leave the current heuristic in place by default but also allow users to explicitly specify the ABI if need be. llvm-svn: 314949
* [libc++] Add site config option for ABI macrosShoaib Meenai2017-10-041-0/+2
| | | | | | | | | | | | | | | | | Some ABI macros affect headers, so it's nice to have a site config option for them. Add a LIBCXX_ABI_DEFINES cmake macro to allow specifying a list of ABI macros to define in the site config. The primary design constraint (as discussed with Eric on IRC a while back) was to not have to repeat the ABI macro names in cmake, which only leaves a free-form cmake list as an option. A somewhat unfortunate consequence is that we can't verify that the ABI macros being defined actually exist, though we can at least perform some basic sanity checking, since all the ABI macros begin with _LIBCPP_ABI_. Differential Revision: https://reviews.llvm.org/D36719 llvm-svn: 314946
* Add C++17 explicit deduction guides to std::pair.Eric Fiselier2017-10-042-1/+6
| | | | | | | This patch adds the newly standardized deduction guides for std::pair, allowing it to work class template deduction. llvm-svn: 314864
* Revert 313789 because gcc doesn't like itMarshall Clow2017-09-202-8/+8
| | | | llvm-svn: 313803
* Mark the __eval methods on independent_bits_engine (and ↵Marshall Clow2017-09-202-8/+8
| | | | | | __independent_bits_engine) as const, since they make no changes to the object. NFC. llvm-svn: 313789
* Fix a bit of UB in __independent_bits_engine. Fixes PR#34663Marshall Clow2017-09-201-2/+3
| | | | llvm-svn: 313776
* [libc++] Account for Microsoft CRT const overloadsShoaib Meenai2017-09-151-0/+4
| | | | | | | | | | Microsoft's CRT already provides the const overloads, and it defines the `_CRT_CONST_CORRECT_OVERLOADS` macro to indicate their presence. Check for this macro before attempting to define our own const-correct overloads, to avoid compiler warnings about casts dropping const qualifiers. llvm-svn: 313377
* [libc++] Remove unnecessary struct tagShoaib Meenai2017-09-151-1/+1
| | | | | | It causes warnings about mismatched tags, and it's not needed. llvm-svn: 313345
* typeinfo: provide a partial implementation for Win32Saleem Abdulrasool2017-09-151-6/+30
| | | | | | | | | | | | | | | | | The RTTI structure is different on Windows when building under MS ABI. Update the definition to reflect this. The structure itself contains an area for caching the undecorated name (which is 0-initialized). The decorated name has a bitfield followed by the linkage name. When std::type_info::name is invoked for the first time, the runtime should undecorate the name, cache it, and return the undecorated name. This requires access to an implementation of __unDName. For now, return the raw name. This uses the fnv-1a hash to hash the name of the RTTI. We could use an alternate hash (murmur? city?), but, this was the quickest to throw together. llvm-svn: 313344
* Fix accidental ADL in std::allocator_traits meta-programming.Eric Fiselier2017-09-151-6/+6
| | | | | | | | | | | There were a number of cases where __double_underscore functions, for example __has_construct_test, were called without being qualified, causing ADL to occur. This patch qualifies those calls to avoid this problem. Thanks to David L. Jones for point out the issue initially. llvm-svn: 313324
* Apply D28224: 'Throw exception after too many steps' Fixes PR#20291. Thanks ↵Marshall Clow2017-09-121-0/+20
| | | | | | to Tim Shen for the patch llvm-svn: 313056
* Make pbump (internally) handle sizes bigger than MAX_INT. Fixes PR#33725 - ↵Marshall Clow2017-09-124-11/+22
| | | | | | thanks to Jonathan Wakely for the report llvm-svn: 313031
* mark mersenne_twister_engine<>::seed(result_type __sd) with ↵Marshall Clow2017-09-111-0/+1
| | | | | | _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK to placate UBSAN. Fixes PR#34160 llvm-svn: 312932
* Add include of <string> to <system_error>, since things in there return ↵Marshall Clow2017-09-111-0/+1
| | | | | | strings. Fixes PR#34529. llvm-svn: 312923
* Fix PR34298 - Allow std::function with an incomplete return type.Eric Fiselier2017-09-102-25/+18
| | | | | | | | | | | | | This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function] whenever the copy constructor or copy assignment operator was required. This patch further constrains that constructor to short circut before evaluating the troublesome SFINAE when `Tp` matches std::function. The original patch is from Alex Lorenz. llvm-svn: 312892
* Revert "Fix PR34298 - Allow std::function with an incomplete return type."Eric Fiselier2017-09-102-18/+25
| | | | | | | | | | | This reverts commit r312890 because the test case fails to compile for older versions of Clang that reject initializing a const object without a user defined constructor. Since this patch should go into 5.0.1, I want to keep it an atomic change, and will re-commit it with a fixed test case. llvm-svn: 312891
* Fix PR34298 - Allow std::function with an incomplete return type.Eric Fiselier2017-09-102-25/+18
| | | | | | | | | | | | | This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function] whenever the copy constructor or copy assignment operator was required. This patch further constrains that constructor to short circut before evaluating the troublesome SFINAE when `Tp` matches std::function. The original patch is from Alex Lorenz. llvm-svn: 312890
* Add even more string_view tests. These found some bugs in the default ↵Marshall Clow2017-09-071-6/+6
| | | | | | parameter value for rfind/find_last_of/find_last_not_of llvm-svn: 312693
* Redirect strftime_l to the locale-ignorant strftime on mingwMartin Storsjo2017-09-061-0/+4
| | | | | | | | | | | | | | | _strftime_l is only available in the numbered msvcrt versions (starting from msvcr80.dll). In the default configuration, mingw targets the unversioned msvcrt.dll - and there, _strftime_l is not available (not even on windows 10). If __MSVCRT_VERSION__ is set to a higher value (indicating a non-default target and wanting to link to msvcrXX.dll), use the correct function. Differential Revision: https://reviews.llvm.org/D37468 llvm-svn: 312617
* Fix PR31166: std::inplace_merge seems to be unstable. Thanks to Jan Wilken ↵Marshall Clow2017-08-281-5/+5
| | | | | | Dörrie for the suggested fix. llvm-svn: 311952
* [NFC] remove trailing WSAditya Kumar2017-08-201-20/+20
| | | | llvm-svn: 311283
* SpellingJoerg Sonnenberger2017-08-181-2/+2
| | | | llvm-svn: 311156
* Change the way the literal operators are defined - now w/o a seperating ↵Marshall Clow2017-08-091-24/+24
| | | | | | space. This should be a NFC, but it will change how the compiler parses it. llvm-svn: 310487
* Fix libcxx build with glibc 2.26+ by removing xlocale.h include.Eric Fiselier2017-08-031-1/+1
| | | | | | Patch by Khem Raj. Reviewed as D35697. Also see PR33729. llvm-svn: 309920
* Add system header pragma to BSD locale fallback headers.Eric Fiselier2017-08-032-0/+8
| | | | | | | This prevent leaking warnings to the user about use of C++11 extensions in C++03. llvm-svn: 309917
* Fix PR33727: std::basic_stringbuf only works with DefaultConstructible ↵Marshall Clow2017-08-021-1/+2
| | | | | | allocators. Thanks to Jonathan Wakely for the report and suggested fix llvm-svn: 309838
* [libc++] Hoist extern template above first useShoaib Meenai2017-07-291-1/+2
| | | | | | | | | | | | This function template is referenced inside class basic_string as a friend function. The extern template declaration needs to be above that friend declaration to actually take effect. This is important because this function was marked as exported in r307966, so without the extern template taking effect, it can leak into other DSOs as a visible symbol. llvm-svn: 309474
* Implement P0739R0: 'Some improvements to class template argument deduction ↵Marshall Clow2017-07-271-3/+3
| | | | | | integration into the standard library' This is an API change (not ABI change) due to a late change in the c++17 standard llvm-svn: 309296
* Remove addtional parameters in function std::next() and std::prev()Rachel Craik2017-07-241-8/+14
| | | | | | | | | | | Creating a function pointer with proper parameters pointing to std::next() or std::prev() should work. This change moves the invented paramater for enable_if over to the return type to resolve this QoI issue. Patch by Jason Liu. Differential Revision: https://reviews.llvm.org/D34649 llvm-svn: 308932
* make sure that we don't call basic_streambuf::gbump with a value bigger than ↵Marshall Clow2017-07-241-1/+2
| | | | | | INT_MAX, since it only takes an int. Related to, but not quite the same as PR33725 llvm-svn: 308880
* Fix grammar-o in comment.Nico Weber2017-07-221-2/+2
| | | | llvm-svn: 308827
* Update _LIBCPP_VERSION and the version in CMakeLists to 6.0Hans Wennborg2017-07-192-2/+2
| | | | llvm-svn: 308468
* Check for _MSC_VER before defining _LIBCPP_MSVCRTBruno Cardoso Lopes2017-07-171-2/+3
| | | | | | | | | | | | Some targets (e.g. Darwin) might have the Win32 API available, but they do not use MSVC CRT. Assume _LIBCPP_MSVCRT only when _MSC_VER is available and __MINGW32__ isn't defined. Differential Revision: https://reviews.llvm.org/D34588 rdar://problem/32628786 llvm-svn: 308225
* Add case for c++2a to libc++ and test macrosMarshall Clow2017-07-171-1/+3
| | | | llvm-svn: 308159
* [libc++] Clean up cl warning 4231 disablingShoaib Meenai2017-07-143-21/+0
| | | | | | | | | Once upon a time, extern templates used to be a Microsoft extension, so cl would warn about their usage, and libc++ suppressed that warning. They've long since been standardized, so the warning is defunct. (libc++ also doesn't currently support building with cl anyway.) llvm-svn: 307997
* [libc++] Mark string operator+ _LIBCPP_FUNC_VISShoaib Meenai2017-07-131-1/+1
| | | | | | | | | | | | | | | It has an extern template instantiation declaration in the headers and a corresponding instantiation definition in the library, so we must mark it with _LIBCPP_FUNC_VIS to make it available outside the library. This doesn't cause any ABI changes as-is since we don't build libc++ with hidden visibility (so the function is exported anyway). It's needed for building libc++ with hidden visibility, however. Clarify the Windows behavior for extern function templates while I'm here, since this exercises that behavior. llvm-svn: 307966
* [libc++] Remove unused _LIBCPP_FUNC_VIS_ONLYShoaib Meenai2017-07-131-5/+0
| | | | | | This has been unused since r282644. llvm-svn: 307965
* Fix unrepresentable enum for clang-cl unstable ABIBen Craig2017-07-121-8/+8
| | | | | | | | | | | | | | When using LIBCXX_ABI_UNSTABLE=YES, clang-cl gave the following warning: P:\llvm_master\src\llvm\projects\libcxx\include\string(683,51): warning: enumerator value is not representable in the underlying type 'int' [-Wmicrosoft-enum-value] Fixed by switching from enums to static const size_type. https://reviews.llvm.org/D35174 llvm-svn: 307751
* Remove <__refstring> header; Move it into source directory.Eric Fiselier2017-07-121-127/+0
| | | | | | | | | | | | | | | | | | | | The libc++ <__refstring> headers has no real reason why it should be a public header that libc++ ships. The only reason it was in the include directory was because libc++abi needed it to build the library. However keeping <__refstring> a header had other problems, like requiring its dependancies to also be in the headers. For that reason this patch moves it into the source directory. To work around libc++abi's need for this header a duplicated copy was added to libc++abi in r307748. While duplicating the code is an unfortunate solution it's the best solution that's currently possible. In the future I would like to start a discussion on the mailing lists about making libc++abi build as a sub-project of libc++, requiring the libc++ sources always be present. llvm-svn: 307749
* Revert "[libc++] Refactoring __sync_* builtins; NFC (Reland)"Eric Fiselier2017-07-122-36/+4
| | | | | | | This reverts commit r307595. The commit had some issues that needed to first be addressed in review. llvm-svn: 307746
* [libcxx][CMake] Add install path variable to allow overriding the destinationPetr Hosek2017-07-111-2/+2
| | | | | | | | | This is going to be used by the runtime build in the multi-target setup to allow using different install prefix for each target. Differential Revision: https://reviews.llvm.org/D33762 llvm-svn: 307615
* [libc++] Refactoring __sync_* builtins; NFC (Reland)Weiming Zhao2017-07-102-4/+36
| | | | | | | | | | | | Summary: Wrap __sync_* builtins with __libcpp_ functions to facility future customizations as atomic operations are unavailable on some targets. Reviewers: danalbert, EricWF, jroelofs Subscribers: joerg, llvm-commits Differential Revision: https://reviews.llvm.org/D34918 llvm-svn: 307595
* Revert "[libc++] Refactoring __sync_* builtins; NFC"Weiming Zhao2017-07-102-36/+4
| | | | | | This reverts commit 72ff8866bca49ee7d24c87673293b4ce88a039ec. llvm-svn: 307593
OpenPOWER on IntegriCloud