summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
* Avoid embedded preprocessor directives in __treeDimitry Andric2016-08-271-5/+8
| | | | | | | | | | Similar to rL242623, move C++ version checks outside of _NOEXCEPT_() macro invocation argument lists, to avoid "embedding a directive within macro arguments has undefined behavior" warnings. Differential Revision: https://reviews.llvm.org/D23961 llvm-svn: 279926
* Add attribute noreturn to functions that throwAditya Kumar2016-08-272-1/+4
| | | | | | | | | Reviewers: mclow.lists, EricWF, howard.hinnant, sebpop Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D21232 llvm-svn: 279903
* Followon to r279744. Find the other exception types and make __throw_XXX ↵Marshall Clow2016-08-259-34/+40
| | | | | | routines (and call them). Remove the generic __libcpp_throw routine, since no one uses it anymore. llvm-svn: 279763
* Remove duplicate inlineMarshall Clow2016-08-251-1/+1
| | | | llvm-svn: 279746
* Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception ↵Marshall Clow2016-08-2530-288/+272
| | | | | | type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855. llvm-svn: 279744
* Remove trailing WS [NFC]Aditya Kumar2016-08-251-15/+15
| | | | llvm-svn: 279731
* [CMake] Be more consistent about naming targets and componentsChris Bieneman2016-08-243-12/+18
| | | | | | | | | | | | | | | Summary: The point of this patch is to have a consistent convention for naming build, check and install targets so that the targets can be constructed from the project name. This change renames a bunch of CMake components and targets from libcxx to cxx. For each renamed target I've added a convenience target that matches the old target name and depends on the new target. This will preserve function of the old targets so that the change doesn't break the world. We can evaluate if it is worth removing the extra targets later. Reviewers: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23699 llvm-svn: 279675
* libc++: add an option to build against compiler-rtSaleem Abdulrasool2016-08-242-1/+8
| | | | | | This mirrors the option in libc++abi to build without libgcc. llvm-svn: 279606
* Revert "libc++: Perform configuration checks with -nodefaultlibs"Saleem Abdulrasool2016-08-241-21/+2
| | | | | | | This reverts SVN r279584 which broke the buildbots. Will re-apply once the issue has been root-caused and fixed. llvm-svn: 279596
* libc++: Perform configuration checks with -nodefaultlibsSaleem Abdulrasool2016-08-231-2/+21
| | | | | | | | | | | | | | | | | We're compiling libc++ with -nodefaultlibs, so we should also pass this option during the configuration checks to ensure those checks are consistent with the actual build. The primary motivation here is to ease cross-compilation against a non-standard set of C++ libraries. Previously, the configuration checks would attempt to link against the standard C++ libraries, which would cause link failures when cross-compiling, even though the actual library link would go through correctly (because of the use of -nodefaultlibs and explicitly specifying any needed libraries). This is more correct even ignoring the motivation, however. Patch by Shoaib Meenai! llvm-svn: 279584
* libcxx: Fix libcxx tests on aarch64 with libunwindAdhemerval Zanella2016-08-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Some tests uses 'long double' to/from conversions and for some targets they are provided by compiler runtime (either compiler-rt or libgcc). However when building libcxx with linunwinder current test configuration at target_info.py do not include the required libraries, as: not llvm_unwinder: "-lc++" "-lm" "-lgcc_s" "-lgcc" "-lpthread" "-lc" "-lgcc_s" "-lgcc" llvm_unwinder "-lc++" "-lm" "-lpthread" "-lc" "-lunwind" "-ldl" This causes some tests build issues with missing symbols on aarch64, for instance, where 'long double' is a binary float with 128-bits with mostly of internal operations being provided by software routines. This patch changes how to define the default linker flags with libunwinder by adding libgcc regardless. I checked and aarch64 and x86_64 with libcxx and libunwind (with and without LIBCXXABI_USE_LLVM_UNWINDER). llvm-svn: 279552
* Add missing include that caused a test failure on Windows. Thanks to STL for ↵Marshall Clow2016-08-221-0/+1
| | | | | | the patch. No functional change. llvm-svn: 279453
* [CMake] Get libcxx building under LLVM/runtimesChris Bieneman2016-08-183-11/+15
| | | | | | | | | | | | | | | | | | | | | Summary: The new LLVM runtimes build directory requires some basic conventions across the runtime projects. These changes make libcxx build under the runtimes subdirectory. The general idea of the changes is that the runtimes subdirectory requires some conventions to be consistent across runtime projects. I expect to have a few more small patches that build on this to tie up check targets and other things useful in development workflows. Summary of changes in this patch: * Renamed variable LLVM_CONFIG -> LLVM_CONFIG_PATH * Renamed variable LIBCXX_BUILT_STANDALONE -> LIBCXX_STANDALONE_BUILD * Add an include of AddLLVM in the tests subdirectory for add_lit_testsuite. Reviewers: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23696 llvm-svn: 279151
* make the associative containers do the right thing for ↵Marshall Clow2016-08-172-1/+163
| | | | | | propogate_on_container_assignment. Fixes bug #29001. Tests are only for <map> right now - more complete tests will come when we revamp our allocator testing structure. llvm-svn: 279008
* Support allocators with explicit conversion constructors. Fixes bug #29000Marshall Clow2016-08-1741-29/+1026
| | | | llvm-svn: 278904
* libcxx: Fix path.compare.pass expected resultAdhemerval Zanella2016-08-151-6/+10
| | | | | | | | | | | | | | | | | | | The expected 'filesystem::path::compare' result states that for different path only result sign contains the information about passed arguments (not its integer value). This is due it uses the output of other compare functions (basic_string_view and char_traits) without further handling and char_traits uses memcmp for final buffer comparison. However for GLIBC on AArch64 the code: int ret = memcmp ("b/a/c", "a/b/c", 1); Results in '64' where for x86_64 it results in '1'. This patch fixes the expected 'filesystem::path::compare' by normalizing all the results before assert comparison. llvm-svn: 278745
* Fix new ASAN failuresEric Fiselier2016-08-152-2/+3
| | | | llvm-svn: 278736
* Use -O1 when testing with ASAN and MSAN to prevent Clang OOM errors.Eric Fiselier2016-08-151-0/+2
| | | | | | | | Currently certain tests get killed when compiled with ASAN at -O0 because they eat all of the systems memory. This doesn't happen at -O1, so enable that to work around the issue. llvm-svn: 278722
* Fix PR28506. Re-enable missing math.h C++11 decls on SunOS. Patch from ↵Eric Fiselier2016-08-152-47/+24
| | | | | | Michal Gorny. llvm-svn: 278716
* Check in SFINAE base class for use in optional/variantEric Fiselier2016-08-151-0/+57
| | | | llvm-svn: 278643
* Add private option to change build dialect from C++11Eric Fiselier2016-08-141-3/+5
| | | | | | | | | | Although libc++ only requires C++11 to build, there are other reasons to turn on a newer dialect in the build. For example IDE's may not highlight any C++14/C++17 in the headers when configured for C++11. This patch add's a private option for changing this. llvm-svn: 278638
* Remove test for the sign of a NaN - doesn't work on MIPS, not strictly ↵Marshall Clow2016-08-111-1/+0
| | | | | | legal. Fixes bug 28936 llvm-svn: 278387
* test: relax the FS test a slight bit to be more reliableSaleem Abdulrasool2016-08-111-1/+2
| | | | | | | | | Some filesystems track atime always. This relaxes the test to accept either a filesystem which does not accurately track atime or does track the atime accurately. This allows the test to pass on filesystems mounted with `strictatime` on Linux or on macOS. llvm-svn: 278357
* Add 'inline' attribute to __init to inline the basic_string's constructorSebastian Pop2016-08-111-0/+5
| | | | | | | | | | | | basic_string's constructor calls init which was not getting inlined. This prevented optimization of const string as init would appear as a call in between a string's def and use. Patch by Laxman Sole and Aditya Kumar. Differential Revision: https://reviews.llvm.org/D22782 llvm-svn: 278356
* Unbreak C++03 build.Eric Fiselier2016-08-111-1/+1
| | | | llvm-svn: 278323
* Refactor test archetypes implementation.Eric Fiselier2016-08-118-167/+209
| | | | llvm-svn: 278319
* Add missing REQUIRES for C++14Eric Fiselier2016-08-112-2/+2
| | | | llvm-svn: 278311
* [libcxx] Add std::anyEric Fiselier2016-08-1144-46/+3844
| | | | | | | | | | | | | | | | | | | Summary: This patch adds std::any by moving/adapting <experimental/any>. This patch also implements the std::any parts of p0032r3 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0032r3.pdf) and LWG 2509 (http://cplusplus.github.io/LWG/lwg-defects.html#2509). I plan to push it in a day or two if there are no comments. Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22733 llvm-svn: 278310
* Implement LWG 2148: Make non-enum default hash specialization well-formedEric Fiselier2016-08-103-9/+54
| | | | | | | | | | | | | | | | | Summary: This patch removes the static_assert for non-enum types in the primary hash template. Instead non-enum types create a hash<T> specialization that is not constructible nor callable. See also: * http://cplusplus.github.io/LWG/lwg-active.html#2543 * https://llvm.org/bugs/show_bug.cgi?id=28917 Reviewers: mclow.lists, EricWF Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D23331 llvm-svn: 278300
* std:: quailfy the calls for cend/crend/cbegin/cend. Fixes bug 28927.Marshall Clow2016-08-102-8/+59
| | | | llvm-svn: 278282
* test/hard_link_count(): Fix test on darwinMatthias Braun2016-08-101-8/+17
| | | | | | | The hard link count that stat reports are different between normal hfs and the case sensitive variant. Accept both. llvm-svn: 278191
* Update in-tree Google Benchmark to current ToT.Eric Fiselier2016-08-0933-290/+1102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've put some work into the Google Benchmark library in order to make it easier to benchmark libc++. These changes have already been upstreamed into Google Benchmark and this patch applies the changes to the in-tree version. The main improvement in the addition of a 'compare_bench.py' script which makes it very easy to compare benchmarks. For example to compare the native STL to libc++ you would run: `$ compare_bench.py ./util_smartptr.native.out ./util_smartptr.libcxx.out` And the output would look like: RUNNING: ./util_smartptr.native.out Benchmark Time CPU Iterations ---------------------------------------------------------------- BM_SharedPtrCreateDestroy 62 ns 62 ns 10937500 BM_SharedPtrIncDecRef 31 ns 31 ns 23972603 BM_WeakPtrIncDecRef 28 ns 28 ns 23648649 RUNNING: ./util_smartptr.libcxx.out Benchmark Time CPU Iterations ---------------------------------------------------------------- BM_SharedPtrCreateDestroy 46 ns 46 ns 14957265 BM_SharedPtrIncDecRef 31 ns 31 ns 22435897 BM_WeakPtrIncDecRef 34 ns 34 ns 21084337 Comparing ./util_smartptr.native.out to ./util_smartptr.libcxx.out Benchmark Time CPU ----------------------------------------------------- BM_SharedPtrCreateDestroy -0.26 -0.26 BM_SharedPtrIncDecRef +0.00 +0.00 BM_WeakPtrIncDecRef +0.21 +0.21 llvm-svn: 278147
* Remove *super* old test suite results doc for Linux and Windows.Eric Fiselier2016-08-093-1005/+0
| | | | | | | | | Neither of these results files has been update in years. Linux now has a dozen or so buildbots tracking it and the Windows results are no longer relevant. I plan on looking into getting a Windows buildbot going using Appveyor in the coming days. llvm-svn: 278087
* Allow building both shared and static libraryPetr Hosek2016-08-083-24/+63
| | | | | | | | | This change allows building both shared and static version of libc++ in a single build, sharing object files between both versions. Differential Revision: https://reviews.llvm.org/D23232 llvm-svn: 278068
* CMakeLists.txt cleanups: synchronize version with rest of LLVM, consistent ↵Eugene Zelenko2016-08-081-7/+6
| | | | | | | | spacing. Differential revision: https://reviews.llvm.org/D23091 llvm-svn: 278032
* Fix copy/move constructor annotation for the uses-allocator test types.Eric Fiselier2016-08-081-9/+19
| | | | | | | Previously the copy/move constructors of the test types did not properly set the arg_id to T const& or T&& respectivly. llvm-svn: 277970
* [libcxx] Add "flag" default arg: basic_regex ptr_size_flag ctorHubert Tong2016-08-072-2/+41
| | | | | | | | | | | | | | | | | | | | | | Summary: The synopsis in C++11 subclause 28.8 [re.regex] has: ``` basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript); ``` The default argument is added to libc++ by this change. Reviewers: mclow.lists, rsmith, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22702 Reapplies r277966. Patch by Jason Liu! llvm-svn: 277968
* Revert r277966. Forgot patch attribution.Hubert Tong2016-08-072-41/+2
| | | | llvm-svn: 277967
* [libcxx] Add "flag" default arg: basic_regex ptr_size_flag ctorHubert Tong2016-08-072-2/+41
| | | | | | | | | | | | | | | | | | | Summary: The synopsis in C++11 subclause 28.8 [re.regex] has: ``` basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript); ``` The default argument is added to libc++ by this change. Reviewers: mclow.lists, rsmith, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22702 llvm-svn: 277966
* Mark LWG 2726 as complete. No code change needed.Eric Fiselier2016-08-071-1/+1
| | | | llvm-svn: 277964
* Add MSVC specifics to .gitignore. Patch from STL@microsoft.comEric Fiselier2016-08-031-0/+4
| | | | llvm-svn: 277575
* Fix compile error due to mismatched iterator types. Patch from STL@microsoft.comEric Fiselier2016-08-031-1/+1
| | | | llvm-svn: 277574
* Fix an MSVC x64 compiler warning. Patch from STL@microsoft.comEric Fiselier2016-08-033-9/+12
| | | | llvm-svn: 277573
* Silence another occurrence of MSVC's suprious unused warning. Patch from ↵Eric Fiselier2016-08-031-1/+4
| | | | | | STL@microsoft.com llvm-svn: 277572
* [libcxx] basic_regex: add traits_type, string_typeHubert Tong2016-08-022-0/+10
| | | | | | | | | | | | | | | | | Summary: In the synopsis in C++11 subclause 28.8 [re.regex], `basic_regex` is specified to have member typedefs `traits_type` and `string_type`. This change adds them to libc++. Reviewers: mclow.lists, rsmith, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22698 Patch by Jason Liu! llvm-svn: 277526
* Pass compilers when configuring Google Benchmark.Eric Fiselier2016-08-021-2/+7
| | | | llvm-svn: 277512
* Fixing 'Aquire' typo and libcxx build.Ben Craig2016-08-022-2/+2
| | | | llvm-svn: 277456
* NFC: fix typoJF Bastien2016-08-011-1/+1
| | | | llvm-svn: 277404
* atomics.align: XFAIL GCCJF Bastien2016-08-011-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | It currently fails because GCC changed the mangling of templates, which affects std::atomic using __attribute__((vector(X))). The bot using GCC 4.9 generates the following message: In file included from /home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp:24:0: /home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic: In instantiation of 'atomic_test<T>::atomic_test() [with T = __vector(2) int]': /home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp:66:3: required from here /home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic:583:5: error: 'std::__1::__gcc_atomic::__gcc_atomic_t<_Tp>::__gcc_atomic_t() [with _Tp = __vector(2) int]' conflicts with a previous declaration __gcc_atomic_t() _NOEXCEPT = default; ^ /home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic:583:5: note: previous declaration 'std::__1::__gcc_atomic::__gcc_atomic_t<_Tp>::__gcc_atomic_t() [with _Tp = __vector(1) int]' /home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic:583:5: note: -fabi-version=6 (or =0) avoids this error with a change in mangling /home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic:583:5: error: 'std::__1::__gcc_atomic::__gcc_atomic_t<_Tp>::__gcc_atomic_t() [with _Tp = __vector(2) int]' conflicts with a previous declaration /home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic:583:5: note: previous declaration 'std::__1::__gcc_atomic::__gcc_atomic_t<_Tp>::__gcc_atomic_t() [with _Tp = __vector(1) int]' /home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic:583:5: note: -fabi-version=6 (or =0) avoids this error with a change in mangling /home/llvm-builder/llvm-buildslave-root/libcxx-libcxxabi-x86_64-linux-ubuntu-gcc49-cxx11/llvm/projects/libcxx/include/atomic:939:5: note: synthesized method 'std::__1::__gcc_atomic::__gcc_atomic_t<_Tp>::__gcc_atomic_t() [with _Tp = __vector(2) int]' first required here __atomic_base() _NOEXCEPT = default; ^ GCC's docs say the following about ABI version 6: Version 6, which first appeared in G++ 4.7, corrects the promotion behavior of C++11 scoped enums and the mangling of template argument packs, const/static_cast, prefix ++ and –, and a class scope function used as a template argument. llvm-svn: 277380
* Adding smart_ptr benchmarkBen Craig2016-08-011-0/+42
| | | | | | | | | Initial draft here: https://reviews.llvm.org/D22470 ... though this is Eric Fiselier's rewrite to fit in with Google Benchmark. llvm-svn: 277373
OpenPOWER on IntegriCloud