Commit Graph

2965 Commits

Author SHA1 Message Date
Eric Fiselier
f76a08728e Update Google Benchmark library.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279989 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29 19:12:01 +00:00
Eric Fiselier
235d71f053 Fix pair::operator=(TupleLike&&).
This assignment operator was previously broken since the SFINAE always resulted
in substitution failure. This caused assignments to turn into
copy construction + assignment.

This patch was originally committed as r279953 but was reverted due to warnings
in the test-suite. This new patch corrects those warnings.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279955 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29 01:43:41 +00:00
Eric Fiselier
0ecda7171c Revert r279953 - Fix pair::operator=(TupleLike&&)
The test emits warnings causing the test-suite to fail. Since I want this
patch merged into 3.9 I'll recommit it with a clean test.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279954 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29 01:39:54 +00:00
Eric Fiselier
15ac5e4dc2 Fix pair::operator=(TupleLike&&).
This assignment operator was previously broken since the SFINAE always resulted
in substitution failure. This caused assignments to turn into
copy construction + assignment.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279953 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29 01:09:47 +00:00
Eric Fiselier
917af0a073 Implement C++17 std::sample.
This patch implements the std::sample function added to C++17 from LFTS. It
also removes the std::experimental::sample implementation which now forwards
to std::sample.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279948 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-28 22:14:37 +00:00
Eric Fiselier
17c38db650 Mark LWG 2716 as complete - shuffle and sample disallows lvalue URNGs.
Libc++'s implementation of shuffle and sample already support lvalue and rvalue
RNG's. This patch adds tests for both categories and marks the issue as complete.

This patch also contains drive-by change for std::experimental::sample which
improves the diagnostics produced when the correct iterator categories are
not supplied.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279947 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-28 21:55:00 +00:00
Eric Fiselier
113315b9a4 Implement LWG 2711. Constrain path members.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279945 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-28 21:26:01 +00:00
Eric Fiselier
d3169f5a4e [Docs] Update libc++ target names after r279675.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279940 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-28 18:33:08 +00:00
Dimitry Andric
1421cf0f79 Avoid embedded preprocessor directives in __tree
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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279926 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-27 19:32:03 +00:00
Aditya Kumar
5db6737a36 Add attribute noreturn to functions that throw
Reviewers: mclow.lists, EricWF, howard.hinnant, sebpop
Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D21232

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-27 02:26:42 +00:00
Marshall Clow
e7acb0e5be Followon to r279744. Find the other exception types and make __throw_XXX routines (and call them). Remove the generic __libcpp_throw routine, since no one uses it anymore.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-25 17:47:09 +00:00
Marshall Clow
7da8c67b81 Remove duplicate inline
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279746 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-25 15:56:55 +00:00
Marshall Clow
14c09a2413 Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279744 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-25 15:09:01 +00:00
Aditya Kumar
fdb4f1713e Remove trailing WS [NFC]
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279731 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-25 11:52:38 +00:00
Chris Bieneman
e0620e29a5 [CMake] Be more consistent about naming targets and components
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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279675 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-24 22:17:06 +00:00
Saleem Abdulrasool
e146f7559d libc++: add an option to build against compiler-rt
This mirrors the option in libc++abi to build without libgcc.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279606 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-24 04:22:52 +00:00
Saleem Abdulrasool
af7f1a8cc3 Revert "libc++: Perform configuration checks with -nodefaultlibs"
This reverts SVN r279584 which broke the buildbots.  Will re-apply once the
issue has been root-caused and fixed.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279596 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-24 00:24:05 +00:00
Saleem Abdulrasool
ab804284ef libc++: Perform configuration checks with -nodefaultlibs
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!

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279584 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-23 23:01:16 +00:00
Adhemerval Zanella
98983c06c5 libcxx: Fix libcxx tests on aarch64 with libunwind
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).


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279552 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-23 19:25:12 +00:00
Marshall Clow
a2586b395b Add missing include that caused a test failure on Windows. Thanks to STL for the patch. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279453 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22 18:45:31 +00:00
Chris Bieneman
8c22696675 [CMake] Get libcxx building under LLVM/runtimes
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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279151 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 21:31:51 +00:00
Marshall Clow
546498cb48 make the associative containers do the right thing for 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279008 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 23:24:02 +00:00
Marshall Clow
d4badbbc5a Support allocators with explicit conversion constructors. Fixes bug #29000
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278904 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 05:58:40 +00:00
Adhemerval Zanella
ea714e73a6 libcxx: Fix path.compare.pass expected result
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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278745 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 21:24:50 +00:00
Eric Fiselier
c2141dfff2 Fix new ASAN failures
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278736 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 20:50:01 +00:00
Eric Fiselier
314fd09e21 Use -O1 when testing with ASAN and MSAN to prevent Clang OOM errors.
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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 19:37:20 +00:00
Eric Fiselier
543cf61be7 Fix PR28506. Re-enable missing math.h C++11 decls on SunOS. Patch from Michal Gorny.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278716 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 18:58:57 +00:00
Eric Fiselier
b901c3475e Check in SFINAE base class for use in optional/variant
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278643 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 01:51:54 +00:00
Eric Fiselier
c9e74ddb6c Add private option to change build dialect from C++11
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.





git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278638 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 22:51:54 +00:00
Marshall Clow
d6e36bb773 Remove test for the sign of a NaN - doesn't work on MIPS, not strictly legal. Fixes bug 28936
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278387 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 18:46:24 +00:00
Saleem Abdulrasool
1f6a37d63e test: relax the FS test a slight bit to be more reliable
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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278357 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 16:58:12 +00:00
Sebastian Pop
bb11bc4dd1 Add 'inline' attribute to __init to inline the basic_string's constructor
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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278356 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 16:51:48 +00:00
Eric Fiselier
1ed1df3a31 Unbreak C++03 build.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278323 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 08:15:35 +00:00
Eric Fiselier
92741e2493 Refactor test archetypes implementation.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278319 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 07:04:14 +00:00
Eric Fiselier
a60053b9ee Add missing REQUIRES for C++14
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278311 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 03:33:41 +00:00
Eric Fiselier
e739d54f86 [libcxx] Add std::any
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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278310 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 03:13:11 +00:00
Eric Fiselier
2d08bc9a9f Implement LWG 2148: Make non-enum default hash specialization well-formed
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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278300 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 22:45:26 +00:00
Marshall Clow
02e94f8095 std:: quailfy the calls for cend/crend/cbegin/cend. Fixes bug 28927.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278282 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 20:04:46 +00:00
Matthias Braun
3df1df14bf test/hard_link_count(): Fix test on darwin
The hard link count that stat reports are different between normal hfs and the
case sensitive variant. Accept both.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 01:02:28 +00:00
Eric Fiselier
30b48cb1b3 Update in-tree Google Benchmark to current ToT.
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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 18:56:48 +00:00
Eric Fiselier
1fceb5e53d Remove *super* old test suite results doc for Linux and Windows.
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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278087 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 03:05:43 +00:00
Petr Hosek
b640da0b31 Allow building both shared and static library
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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278068 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 22:57:25 +00:00
Eugene Zelenko
96f10171c0 CMakeLists.txt cleanups: synchronize version with rest of LLVM, consistent spacing.
Differential revision: https://reviews.llvm.org/D23091


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278032 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 18:01:50 +00:00
Eric Fiselier
9639abed2e Fix copy/move constructor annotation for the uses-allocator test types.
Previously the copy/move constructors of the test types did not
properly set the arg_id to T const& or T&& respectivly.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@277970 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 02:22:41 +00:00
Hubert Tong
7f6e8e2141 [libcxx] Add "flag" default arg: basic_regex ptr_size_flag ctor
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!


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@277968 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 22:26:04 +00:00
Hubert Tong
5f9ee490e7 Revert r277966. Forgot patch attribution.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@277967 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 22:23:24 +00:00
Hubert Tong
9bae734ed9 [libcxx] Add "flag" default arg: basic_regex ptr_size_flag ctor
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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@277966 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 22:18:33 +00:00
Eric Fiselier
83e9013655 Mark LWG 2726 as complete. No code change needed.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@277964 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 21:47:06 +00:00
Eric Fiselier
eeae30ead0 Add MSVC specifics to .gitignore. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@277575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-03 05:51:19 +00:00
Eric Fiselier
2d9e2e2bc8 Fix compile error due to mismatched iterator types. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@277574 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-03 05:50:03 +00:00