Commit Graph

3584 Commits

Author SHA1 Message Date
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
Petr Hosek
0758410191 Revert "[CMake][libcxx] Move Python check to main CMake file"
This reverts commit 39441fe9f0.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 23:56:33 +00:00
Petr Hosek
b81ce92008 Revert "[CMake][libcxx] Do not rely on the existence of c++abi or unwind targets"
This reverts commit 94fc5a96f5.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291727 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 23:56:31 +00:00
Petr Hosek
010074a596 Revert "[CMake][libcxx] Check that we have libcxxabi before using it"
This reverts commit 8c91834411.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291726 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 23:56:29 +00:00
Petr Hosek
8c91834411 [CMake][libcxx] Check that we have libcxxabi before using it
When doing standalone build, check that we actually have libcxxabi
before attempting to use it.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291723 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 23:11:40 +00:00
Petr Hosek
94fc5a96f5 [CMake][libcxx] Do not rely on the existence of c++abi or unwind targets
There is no guaranteed order in which CMake files for individual
runtimes are invoked and therefore we cannot rely on existence of
targets defined in other runtimes. Use the new HAVE_<name> options
instead in those cases.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291632 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 00:56:10 +00:00
Petr Hosek
39441fe9f0 [CMake][libcxx] Move Python check to main CMake file
This is to make sure this check is called even when building as
part of LLVM runtimes when we are doing standalone but not out of
tree build.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291592 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 19:51:17 +00:00
Marshall Clow
bd7c88461b Qualify some type names that I thought were fine, but some of the bots don't like.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291580 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 18:40:01 +00:00
Marshall Clow
f6c0b90773 Fix up some mismatched SFINAE conditionsin shared_ptr; some used '_Tp*', others used 'element_type *'. Today, they're the same - but soon they won't be. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291572 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 16:59:33 +00:00
Roger Ferrer Ibanez
47b1cefa76 Mark tests as unsupported under libcpp-no-exceptions
The destructor of std::promise needs to construct a std::future_error
exception so it calls std::make_exception_ptr. But under
libcpp-no-exceptions this will trigger an abort.

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



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291550 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 08:48:48 +00:00
Saleem Abdulrasool
1d3240888f threading_support: delete the critical section
Although the CriticalSection itself doesnt need to be destroyed, there
may be debug data associated with it.  Plug a possible small leak.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291536 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 04:18:47 +00:00
Bruno Cardoso Lopes
f7dbfec9d3 [Chrono][Darwin] Include header for gettimeofday
Followup on r291466 and include the proper header. This fixes:
https://build.chromium.org/p/chromium.fyi/builders/ClangToTMac/builds/12620/steps/gclient%20runhooks/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291517 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 00:51:02 +00:00
Michal Gorny
174ff71839 [cmake] Obtain LLVM_CMAKE_PATH from llvm-config if available
Use the new --cmakedir option to obtain LLVM_CMAKE_PATH straight from
llvm-config. Fallback to local reconstruction if llvm-config does not
support this option.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291508 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 23:41:38 +00:00
Justin Bogner
7ebce14ad5 Adorn __call_once_proxy with inline and _LIBCPP_INLINE_VISIBILITY
As per discussion with mclow and EricWF on irc, this is small and
simple enough to deserve being inlined.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291497 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 23:07:12 +00:00
Marshall Clow
f3e7677540 Swap two lines in __mutex_base. On systems with high clock rates, we could mistakenly return no_timeout when a mutex had timed out if we got a tick between these two lines. Thanks to Brian Cain for the bug report.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291492 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 22:32:11 +00:00
Dimitry Andric
8fe92cc0c9 Move _PairT declaration out of __hash_combine to avoid warning under C++98
Summary:
Some parts of the FreeBSD tree are still compiled with C++98, and until
rL288554 this has always worked fine.  After that, a complaint about the
newly introduced local _PairT is produced:

    /usr/include/c++/v1/memory:3354:27: error: template argument uses local type '_PairT' [-Werror,-Wlocal-type-template-args]
        typedef __scalar_hash<_PairT> _HashT;
                              ^~~~~~
    /usr/include/c++/v1/memory:3284:29: error: template argument uses local type '_PairT' [-Werror,-Wlocal-type-template-args]
        : public unary_function<_Tp, size_t>
                                ^~~
    /usr/include/c++/v1/memory:3356:12: note: in instantiation of template class 'std::__1::__scalar_hash<_PairT, 2>' requested here
        return _HashT()(__p);
               ^

As far as I can see, there should be no problem moving the _PairT
struct to just before the __hash_combine() function, which fixes this
particular warning.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits, emaste

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291476 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 20:29:35 +00:00
Marshall Clow
6b78198fc5 Added XFAIL for the apple versions of clang as well
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291475 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 20:29:28 +00:00
Bruno Cardoso Lopes
ac7fc6cf28 [Chrono][Darwin] Make steady_clock use CLOCK_UPTIME_RAW
Use CLOCK_UPTIME_RAW in case clock_gettime is available on Darwin.

On Apple platforms only CLOCK_UPTIME_RAW or mach_absolute_time are able
to time functions in the nanosecond range. Thus, they are the only
acceptable implementations of steady_clock.

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

rdar://problem/29449467

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291466 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 19:21:48 +00:00
Marshall Clow
7d32d2f5a1 Implement P0403R1 - 'Literal suffixes for basic_string_view'. Requires clang 4.0 (specifically, r290744)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291457 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 18:07:34 +00:00
Asiri Rathnayake
da39f1bc79 [libcxx] Fix externally-threaded shared library builds after r291275.
Need to allow unresolved symbols in the dylib. This was previously done for
LIBCXX_HAS_EXTERNAL_THREAD_API, but we have since split that into two with
LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY being the externally-threaded variant.

Also a minor CMakeLists.txt cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291433 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 10:38:56 +00:00
Eric Fiselier
c60e8fcdcd Replace identifiers called __out because Windows.h #defines it.
Windows is greedy and it defines the identifier `__out` as a macro.
This patch renames all conflicting libc++ identifiers in order
to correctly work on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291345 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 11:27:06 +00:00
Michael Park
09a03c6b1f Added "Michael Park" to CREDITS.TXT.
Summary: Test commit + give myself credit.

Reviewers: EricWF

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291344 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 10:19:24 +00:00
Eric Fiselier
1da5694983 [libc++] Implement terminate(), unexpected() and uncaught_exceptions() on Windows
Summary:
This patch implements the following functions on Windows by forwarding to the MSVCRT:

* `get_terminate()`
* `set_terminate()`
* `terminate()`
* `set_unexpected()`
* `get_unexpected()`
* `unexpected()`
* `uncaught_exception()`

* `uncaught_exceptions()`

Reviewers: compnerd, rnk, majnemer, smeenai

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291343 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 10:04:40 +00:00
Eric Fiselier
34777546b9 Ensure Sleep(...) isn't passed the value 0 on Windows
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291342 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 09:53:28 +00:00