Commit Graph

3639 Commits

Author SHA1 Message Date
Eric Fiselier
1bd94ed50d Fix bad XFAIL which recent LIT changes diagnosed
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292905 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 10:19:32 +00:00
Eric Fiselier
66ed0bc836 Remove all usages of REQUIRES-ANY in the test suite.
Pending LIT changes are about to remove the REQUIRES-ANY keyword
in place of supporting boolean && and || within "REQUIRES". This
patch prepares libc++ for that change so that when applied
the bots don't lose their mind.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292901 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 09:11:08 +00:00
Eric Fiselier
2c90d1f776 [libcxx] Never use <cassert> within libc++
Summary:
It is my opinion that libc++ should never use `<cassert>`, including in the `dylib`. This patch remove all uses of `assert` from within libc++ and replaces most of them with `_LIBCPP_ASSERT` instead.

Additionally this patch turn `LIBCXX_ENABLE_ASSERTIONS`  off by default, because the standard library should not be aborting user programs unless explicitly asked to.

Reviewers: mclow.lists, compnerd, smeenai

Reviewed By: mclow.lists

Subscribers: mgorny, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292883 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 04:57:33 +00:00
Eric Fiselier
cdb5d25004 Manually force the use of __decltype in C++03 with Clang 3.4.
<string> uses `decltype` in a way incompatible with `__typeof__`.
This is problematic when compiling <string> with Clang 3.4 because
even though it provides `__decltype` libc++ still used `__typeof__`
because clang 3.4 doesn't provide __is_identifier which libc++
uses to detect __decltype.

This patch manually detects Clang 3.4 and properly configures
for it.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292833 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 21:41:13 +00:00
Eric Fiselier
f472d6c89d Fix GCC C++03 build by hiding default template argument in C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292830 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 21:24:58 +00:00
Marshall Clow
fbe68a68ab Implement LWG#2778: basic_string_view is missing constexpr.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292823 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 19:53:28 +00:00
Marshall Clow
6111e65cba Fixed a typo in __config that prevented the aligned new/delete tests from passing on Mac OS.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292822 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 19:51:54 +00:00
Marshall Clow
ec1d3f7e2d Revert previous cleanup; I got too agressive removing #ifdefs
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292809 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 18:00:15 +00:00
Marshall Clow
45f4ec28a2 Removed some un-needed ifdefs
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292806 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 17:25:38 +00:00
Eric Fiselier
85e34e4ab7 Revert accidentally changes which reverted r292582
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292717 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-21 14:42:44 +00:00
Eric Fiselier
17b6e14cdc Fix recent build errors
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292689 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-21 00:57:29 +00:00
Eric Fiselier
952eaecfc6 Implement P0513R0 - "Poisoning the Hash"
Summary:
Exactly what the title says.

This patch also adds a `std::hash<nullptr_t>` specialization in C++17, but it was not added by this paper and I can't find the actual paper that adds it.

See http://wg21.link/P0513R0 for more info.

If there are no comments in the next couple of days I'll commit this

Reviewers: mclow.lists, K-ballo, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292684 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-21 00:02:12 +00:00
Eric Fiselier
ee856f131d Don't default older GCC's to C++17, but C++14 or C++11 instead
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292607 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 12:54:45 +00:00
Eric Fiselier
0cefc52072 Revert "Don't default older GCC's to C++17, but C++14 or C++11 instead"
The commit isn't quite right, and I want to only have to merge one
commit into 4.0

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292606 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 12:52:59 +00:00
Eric Fiselier
76c85b10e2 Don't default older GCC's to C++17, but C++14 or C++11 instead
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292605 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 12:46:57 +00:00
Eric Fiselier
19b1c83593 Still expose std::align_val_t in C++17 even if we don't have aligned new/delete.
r292564 disabled the aligned new/delete overloads on platforms without
posix_memalign. Unfortunately that patch also disabled the  align_val_t
definition in C++17 as well.

This patch causes align_val_t to be exposed in C++17 regardless
of if we have the new/delete overloads.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292582 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 06:27:34 +00:00
Eric Fiselier
478f902c62 Refactor unique_ptr/shared_ptr deleter test types into single header.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292577 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 04:39:17 +00:00
Eric Fiselier
d54d974f1f Disable aligned new/delete on Apple platforms without posix_memalign
Summary:
This patch disables the aligned new/delet overloads on Apple platforms without `posix_memalign`. This fixes libc++.dylib build regressions on such platforms.
This fixes http://llvm.org/PR31448.

This patch should also be merged into the 4.0 release branch


Reviewers: mclow.lists, rsmith, dexonsmith, jeremyhu

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292564 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 01:47:26 +00:00
Eric Fiselier
e28ff33405 [NFC] Group aligned new/delete definitions together in new.cpp
This patch is cleanup to prepare for future changes

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292560 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 01:13:49 +00:00
Eric Fiselier
fba0eeeddd Fix handling of Apple target triple when checking the ABI lists.
The check-cxx-abilist rule uses TARGET_TRIPLE to determine which
ABI list to check. However the triple on Apple contains the darwin
version which changes frequently, but libc++ doesn't need
different ABI lists for each darwin version.

This patch strips the minor version and patchlevel from TARGET_TRIPLE
before using it to determine the ABI list.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292557 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 00:57:08 +00:00
Eric Fiselier
e013dacf4a Fix demangle helper after r286788
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292541 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 00:00:31 +00:00
Eric Fiselier
e70e03c7f6 Adjust msvc_stdlib_force_include.hpp to handle clang++
Summary: This patch adjusts the newly added `msvc_stdlib_force_include.hpp` so that it also works when used with `clang++`.

Reviewers: STL_MSFT

Reviewed By: STL_MSFT

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292539 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-19 23:48:05 +00:00
Marshall Clow
56257d4918 Mark two of the TS implementations as 'in progress'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292490 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-19 15:30:36 +00:00
Stephan T. Lavavej
aa0c167446 [libcxx] [test] Add msvc_stdlib_force_include.hpp.
No functional change; nothing includes this, instead our test harness
injects it via the /FI compiler option.

No code review; blessed in advance by EricWF.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292443 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 22:19:14 +00:00
Stephan T. Lavavej
16e2ba19df [libcxx] [test] Fix comment typos, strip trailing whitespace.
No functional change, no code review.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292434 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 20:10:25 +00:00
Stephan T. Lavavej
c3564b92bc [libcxx] [test] Fix MSVC warnings C4127 and C6326 about constants.
MSVC has compiler warnings C4127 "conditional expression is constant" (enabled
by /W4) and C6326 "Potential comparison of a constant with another constant"
(enabled by /analyze). They're potentially useful, although they're slightly
annoying to library devs who know what they're doing. In the latest version of
the compiler, C4127 is suppressed when the compiler sees simple tests like
"if (name_of_thing)", so extracting comparison expressions into named
constants is a workaround. At the same time, using std::integral_constant
avoids C6326, which doesn't look at template arguments.

test/std/containers/sequences/vector.bool/emplace.pass.cpp
Replace 1 == 1 with true, which is the same as far as the library is concerned.

Fixes D28837.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292432 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 20:09:56 +00:00
Eric Fiselier
0d4bd61d78 Re-add mechanism to override LIT options using enviroment variables.
There was a dumb mistake in the original commit that has now
been fixed

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292351 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 07:56:57 +00:00
Eric Fiselier
3dcf50c4b2 Revert "Add mechanism to override LIT options using enviroment variables"
The buildbots currently depend on the old configuration. I'll recommit
once Zorg is fixed and reset

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292347 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 06:24:18 +00:00
Eric Fiselier
55c5f6be8d Add mechanism to override LIT options using enviroment variables
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292346 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 06:08:38 +00:00
Eric Fiselier
f2b48899a5 Fix filesystem::path assignment from {}
Adding `path::operator=(string_type&&)` made the expression `p = {}`
ambiguous. This path fixes that ambiguity by making the `string&&`
overload a template so it ranks lower during overload resolution.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292345 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 05:48:55 +00:00
Eric Fiselier
6fb6490957 Get more std::string _LIBCPP_DEBUG tests passing
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292342 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 05:34:42 +00:00
Eric Fiselier
44dbdb4b85 More configuration changes for running the test suite against MSVC's STL
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292337 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 03:57:38 +00:00
Eric Fiselier
6fbac40a30 Add support for running our test suite against MSVC's STL
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292326 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 01:48:54 +00:00
Eric Fiselier
08305aaf6e Allow sym_diff.py to report non-zero for non-breaking ABI changes
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292297 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:05:01 +00:00
Eric Fiselier
1b30568b31 Fix type_info's constructor by making it explicit again.
In recent changes type_info's private constructor was
accidentally made implicit. This patch fixes that.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292294 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 23:41:42 +00:00
Eric Fiselier
8e39559043 Don't strip -m32 from the user provide command line flags. This fixes the compiler-rt 32 bit sanitizer build
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292291 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 23:27:56 +00:00
Stephan T. Lavavej
c8fc92cc09 [libcxx] [test] Don't ask whether Incomplete& can be assigned to.
This is the subject of an active NB comment. Regardless of what the Working
Paper currently says, asking this question is morally wrong, because the
answer can change when the type is completed. C1XX now detects such
precondition violations and complains about them; perhaps Clang should too.

Fixes D28591.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292281 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 22:24:45 +00:00
Eric Fiselier
37b2be9c58 Fix std::string assignment ambiguity from braced initializer lists.
When support for `basic_string_view` was added to string it also
added new assignment operators from `basic_string_view`. These caused
ambiguity when assigning from a braced initializer. This patch fixes
that regression by making the basic_string_view assignment operator
rank lower in overload resolution by making it a template.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292276 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 22:10:32 +00:00
Eric Fiselier
a7ae303de3 Add ABI option to remove recently inlined __shared_count functions from the library.
In order to allow inlining of previously out-of-line functions without an ABI break
libc++ provides legacy definitions in the dylib that old programs can
continue to use. Unfortunatly Windows link.exe detects this hack and diagnoses the duplicate
definitions.

This patch disable the duplicate definitions on Windows by adding an ABI option
which disables all "legacy out-of-line symbols"

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292190 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 03:16:26 +00:00
Eric Fiselier
9133eadd60 Fix DLL build by removing _LIBCPP_FUNC_VIS from member of class marked dllexport
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292185 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 03:05:31 +00:00
Kevin Hu
8993759ae9 [Test patch] Inline hot functions in libcxx shared_ptr
Moves hot functions such as atomic add into the memory header file
so that they can be inlined, which brings performance benefits.

Patch by Kevin Hu, Aditya Kumar, Sebastian Pop

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292184 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 02:46:33 +00:00
Eric Fiselier
2e5a364ebc Add warning messages to buildit/testit about their upcoming removal
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292181 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 01:16:44 +00:00
Eric Fiselier
ebb9839230 Rename new_handler in tests to avoid conflicts with MSVC symbols.
On Windows the header new.h defines "new_handler" in the global
namespace.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292177 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 00:32:08 +00:00
Eric Fiselier
7d24e9101d Fix std::tuples EBO when targeting the MSVC ABI.
MSVC/clang-cl doesn't do a full EBO unless __declspec(empty_bases)
is applied to the derived type. This causes certain tuple tests
to fail.

This patch adds the empty_bases attribute to __tuple_impl in order
for tuple to fully provide the EBO.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292159 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 21:15:08 +00:00
Eric Fiselier
dae39608bb [libc++] Introduce _LIBCPP_EXTERN_VIS to fix __libcpp_debug_function link errors
Summary: On Windows tests that use `_LIBCPP_ASSERT` fail to link because the assertion handler function isn't correctly exported from the libc++ dylib. This patch fixes the dll import/export issues by introducing a new visibility macro `_LIBCPP_EXTERN_VIS` for use on external variables.

Reviewers: compnerd, smeenai, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292158 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 21:01:00 +00:00
Eric Fiselier
bde2871b62 Improve CMake and LIT support for Windows
This patch contains multiple cleanups and fixes to better support building on
Windows.

* [Test] Fix handling of library runtime search paths by correctly adding them
  to the PATH variable when running the tests.

* [Test] Don't explicitly force "--target=i686-pc-windows" when running the
  test suite. Clang++ seems to deduce the correct target.

* [Test] Fix `.sh.cpp` tests on Windows by properly escaping flags used in
  shell commands. Specifically windows style paths which included spaces
  were causing these tests to fail.

* [CMake] Add "vcruntime" to the list of supported C++ ABI libraries in CMake, and
  teach the test suite how to handle it. For now libc++ defaults to using
  "vcruntime" on Windows except when libc++abi is in tree; That is probably
  a bug and should be changed to always use vcruntime, at least for now.

* [Misc] Move the "c++-build" include directory to the libc++ binary dir
  instead of the top level project dir and rename it "c++build". This is just
  misc cleanup. Libc++ shouldn't be creating internal build files and directories
  at the top-level projects root.

* [Misc] Build type_info's destructor when building for MSVC. This is a temporary
  work around to prevent link errors until we have a proper type_info
  implementation.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292157 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 20:47:35 +00:00
Eric Fiselier
47a547e438 Make sym_check python 3 compatible
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292152 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 19:52:58 +00:00
Asiri Rathnayake
24872f4e35 [libcxx] Follow-up to r292107
I've missed a couple of updates. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292109 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 13:13:01 +00:00
Asiri Rathnayake
49a9e0c64c [libcxx] Improve design documentation for the external-thread-library
configuration

NFC.

Differential revision: https://reviews.llvm.org/D28610

Reviewers: EricWF

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292108 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 12:44:08 +00:00
Asiri Rathnayake
a1d7d2ffb8 [libcxx] Don't assume __libcpp_thread_t is an integral type
We have already refactored the underlying platform thread type into
__libcpp_thread_t, but there are few places in the source where we
still assume it is an integral type.

This patch refactores those points back into the threading API.

Differential revision: https://reviews.llvm.org/D28608

Reviewers: EricWF

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292107 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 12:19:54 +00:00