Commit Graph

3607 Commits

Author SHA1 Message Date
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
Michael Park
b894a0b46d Added a workaround for a -fdelayed-template-parsing bug.
Summary:
There seems to be an additional bug in `-fdelayed-template-parsing`
similar to
http://llvm.org/viewvc/llvm-project?view=revision&revision=236063.

This is a workaround for it for <variant> to compile with `clang-cl` on Windows.

Reviewers: EricWF

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292097 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 08:14:25 +00:00
Marshall Clow
d25c997c77 Implement the missing constexpr stuff in <array>. Fixes PR#31645.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292091 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 03:02:10 +00:00
Petr Hosek
6948dbedca Reland "[CMake][libcxx] Check that we have libcxxabi before using it"
This relands commit r291726.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292086 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 00:33:11 +00:00
Petr Hosek
c59c3172dc Reland "[CMake][libcxx] Do not rely on the existence of c++abi or unwind targets"
This relands commit r291727.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292085 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 00:33:09 +00:00
Petr Hosek
3508e7a877 Reland "[CMake][libcxx] Move Python check to main CMake file"
This relands commit r291728.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292084 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 00:33:07 +00:00
Eric Fiselier
f620d224b7 Work around python3 bytes vs str in libc++ test config
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292038 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 00:06:02 +00:00
Eric Fiselier
5cd8a36772 XFAIL native handle tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292029 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 20:25:25 +00:00
Eric Fiselier
5fd0d08f72 Fix demangle.h on Windows
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292028 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 20:21:18 +00:00
Eric Fiselier
543e83bfc7 Attempt two at fixing threading on Windows
Reviewers: compnerd

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292027 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 20:19:00 +00:00
Eric Fiselier
433a39703b Fix thread creation on Windows
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292022 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 19:11:07 +00:00
Jonas Hahnfeld
29d52a28e4 Fix last_write_time tests for filesystems that don't support negative and very large times
Seems to be the case for NFS.

Original patch by Eric Fiselier!
Differential Revision: https://reviews.llvm.org/D22452

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292013 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 11:35:15 +00:00
Eric Fiselier
06192cb774 Mark test as UNSUPPORTED on Windows since it hangs forever
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292012 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 10:31:43 +00:00
Eric Fiselier
30d12e372a Fix Windows try_lock implementation
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292011 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 10:27:12 +00:00
Eric Fiselier
78463e748d Fix copy-paste errors in r292001
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292010 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 10:22:21 +00:00
Eric Fiselier
157fd34124 [libc++][CMake] Use debug MSVC runtimes when libc++ is built in debug mode
Summary: This patch allows libc++ to be built against the debug MSVC runtimes instead of just the release ones.

Reviewers: rnk, majnemer, compnerd, smeenai

Subscribers: mgorny, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292006 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 07:54:39 +00:00
Eric Fiselier
fdd3c91b5f [libc++] [CMake] Link with /nodefaultlibs on Windows
Summary:
This patch attempts to fix the libc++ build/link so that it doesn't use an default C++ libraries on Windows.  This is needed to prevent linking to MSVC's STL library.

Additionally this patch changes libc++ so that it is always linked with the non-debug DLL's (e.g. `/MD`). This is needed so that the test suite can correctly link the same libraries without needing to know which configuration `c++.dll` was linked with.


Reviewers: compnerd, rnk, majnemer, kimgr, awson, halyavin, smeenai

Subscribers: cfe-commits, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292001 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 06:06:47 +00:00
Marshall Clow
8d2a5ad70b Mark 'constexpr char_traits' as complete.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292000 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 05:55:17 +00:00
Eric Fiselier
f19b75f913 Tweak .clang-format configuration.
Remove the custom configuration options for brace wrapping. They
don't work well for inline functions or type-traits classes.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291998 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 05:43:02 +00:00
Eric Fiselier
50ca3248fb Use __is_identifier to detect Clang extensions instead of __has_extension.
When -pedantic-errors is specified `__has_extension(<feature>)` is always
false when it would otherwise be true. This causes C++03 <atomic> to break
along with other issues.

This patch avoids the above problem by using __is_identifier(...) instead since
it is not affected by -pedantic-errors. For example instead of checking for
__has_extension(c_atomics) we now check `!__is_identifier(_Atomic)`, which
is only true when _Atomic is not a keyword provided by the compiler.

This patch applies similar changes to the detection logic for __decltype and
__nullptr as well.

Note that it does not apply this change to the C++03
`static_assert` macro since -Wc11-extensions warnings generated by expanding
that macro will appear in user code, and will not be suppressed as part of a
system header.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291995 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 04:27:58 +00:00
Eric Fiselier
d5904a2764 Don't dump llvm-config --cmakedir output if command fails.
This patch adjusts the out-of-tree CMake configuration so that
the stderr output is ignored when an old llvm-config is found
that doesn't support --cmakedir.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291991 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 03:35:15 +00:00
Eric Fiselier
cdffd52947 Don't force use of lld in tests on Windows
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291987 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 01:58:01 +00:00
Eric Fiselier
bfcceeeadf Remove unused parameters in C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291986 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 01:33:53 +00:00
Eric Fiselier
5ed767588b Diagnose invalid memory orderings in <atomic>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291976 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 23:45:39 +00:00
Eric Fiselier
eaf292013d Diagnose non-const-callable hash functions and comparators
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291969 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 22:42:53 +00:00
Eric Fiselier
ebaf7dab14 Add _LIBCPP_DIAGNOSE_WARNING and _LIBCPP_DIAGNOSE_ERROR macros.
Clang recently added a `diagnose_if(cond, msg, type)` attribute
which can be used to generate diagnostics when `cond` is a constant
expression that evaluates to true. Otherwise no attribute has no
effect.

This patch adds _LIBCPP_DIAGNOSE_ERROR/WARNING macros which
use this new attribute. Additionally this patch implements
a diagnostic message when a non-const-callable comparator is
given to a container.

Note: For now the warning version of the diagnostic is useless
within libc++ since warning diagnostics are suppressed by the
system header pragma. I'm going to work on fixing this.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291961 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 22:02:08 +00:00
Eric Fiselier
ccb58d0a2c Update version to 5.0
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291928 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 18:29:56 +00:00
Eric Fiselier
1669d3dac5 Fix merge conflict caused by r291921
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291925 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 18:25:13 +00:00
Eric Fiselier
1a147b7d64 Revert "Rework fix for PR19460 - Use explicit bool as an extension instead."
This reverts commit 3a1b90a866.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291921 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 18:03:46 +00:00
Marshall Clow
c4d3afdfad Add new macro _LIBCPP_BUILTIN_MEMCMP_ISCONSTEXPR to use in std::char_traits.
This tells whether or not the builtin function __builtin_memcmp is constexpr.
Only defined for clang 4.0 and later, and not true for any shipping version of Apple's clang.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291773 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 16:25:07 +00:00
Shoaib Meenai
c84cd4a090 [libc++] Pair _aligned_malloc with _aligned_free
Attempting to pair an `_aligned_malloc` with a regular free causes heap
corruption. Pairing with `_aligned_free` is required instead.

Makes the following libc++ tests pass on Windows:

```
std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp
std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp
std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp
std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp
```

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291743 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 06:22:36 +00:00
Marshall Clow
d704617793 disable use of __builtin_memcmp temporarily to get the tests passing again
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291742 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 05:40:58 +00:00
Marshall Clow
ce921fa962 Implement P0426: Constexpr for std::char_traits
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291741 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 04:37:14 +00:00