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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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