Commit Graph

3574 Commits

Author SHA1 Message Date
Eric Fiselier 4b3dc18cf1 Work around python3 bytes vs str in libc++ test config
llvm-svn: 292038
2017-01-15 00:06:02 +00:00
Eric Fiselier 12ed728c23 XFAIL native handle tests
llvm-svn: 292029
2017-01-14 20:25:25 +00:00
Eric Fiselier 121baf4fc9 Fix demangle.h on Windows
llvm-svn: 292028
2017-01-14 20:21:18 +00:00
Eric Fiselier d75a9d253f Attempt two at fixing threading on Windows
Reviewers: compnerd

Subscribers: cfe-commits

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

llvm-svn: 292027
2017-01-14 20:19:00 +00:00
Eric Fiselier 6f38b6ab6e Fix thread creation on Windows
llvm-svn: 292022
2017-01-14 19:11:07 +00:00
Jonas Hahnfeld 0ab3b77294 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

llvm-svn: 292013
2017-01-14 11:35:15 +00:00
Eric Fiselier 117c4affa6 Mark test as UNSUPPORTED on Windows since it hangs forever
llvm-svn: 292012
2017-01-14 10:31:43 +00:00
Eric Fiselier 08e1477ccb Fix Windows try_lock implementation
llvm-svn: 292011
2017-01-14 10:27:12 +00:00
Eric Fiselier 666c64b155 Fix copy-paste errors in r292001
llvm-svn: 292010
2017-01-14 10:22:21 +00:00
Eric Fiselier 7e3ee09ad2 [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

llvm-svn: 292006
2017-01-14 07:54:39 +00:00
Eric Fiselier cc1f65ca30 [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

llvm-svn: 292001
2017-01-14 06:06:47 +00:00
Marshall Clow 2f116c432d Mark 'constexpr char_traits' as complete.
llvm-svn: 292000
2017-01-14 05:55:17 +00:00
Eric Fiselier 1d0d456819 Tweak .clang-format configuration.
Remove the custom configuration options for brace wrapping. They
don't work well for inline functions or type-traits classes.

llvm-svn: 291998
2017-01-14 05:43:02 +00:00
Eric Fiselier 1e33f12a7c 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.

llvm-svn: 291995
2017-01-14 04:27:58 +00:00
Eric Fiselier 18cfd4d345 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.

llvm-svn: 291991
2017-01-14 03:35:15 +00:00
Eric Fiselier e3061a4065 Don't force use of lld in tests on Windows
llvm-svn: 291987
2017-01-14 01:58:01 +00:00
Eric Fiselier a595b7f0f9 Remove unused parameters in C++03
llvm-svn: 291986
2017-01-14 01:33:53 +00:00
Eric Fiselier faf2a81380 Diagnose invalid memory orderings in <atomic>
llvm-svn: 291976
2017-01-13 23:45:39 +00:00
Eric Fiselier 04333f9bda Diagnose non-const-callable hash functions and comparators
llvm-svn: 291969
2017-01-13 22:42:53 +00:00
Eric Fiselier b1e7a12ee8 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.

llvm-svn: 291961
2017-01-13 22:02:08 +00:00
Eric Fiselier d066f3af61 Update version to 5.0
llvm-svn: 291928
2017-01-13 18:29:56 +00:00
Eric Fiselier a0f7252b03 Fix merge conflict caused by r291921
llvm-svn: 291925
2017-01-13 18:25:13 +00:00
Eric Fiselier c8bd38a15d Revert "Rework fix for PR19460 - Use explicit bool as an extension instead."
This reverts commit 3a1b90a866b6d5d62a5f37fbfb3a1ee36cc70dd1.

llvm-svn: 291921
2017-01-13 18:03:46 +00:00
Marshall Clow 3d4cc68b8b 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.

llvm-svn: 291773
2017-01-12 16:25:07 +00:00
Shoaib Meenai 7ce92f73f2 [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

llvm-svn: 291743
2017-01-12 06:22:36 +00:00
Marshall Clow 9087bbee85 disable use of __builtin_memcmp temporarily to get the tests passing again
llvm-svn: 291742
2017-01-12 05:40:58 +00:00
Marshall Clow 05d57faa2e Implement P0426: Constexpr for std::char_traits
llvm-svn: 291741
2017-01-12 04:37:14 +00:00
Petr Hosek 895f24ce17 Revert "[CMake][libcxx] Move Python check to main CMake file"
This reverts commit 39441fe9f00a58ffc2fdff92a4b0e8a280a5f444.

llvm-svn: 291728
2017-01-11 23:56:33 +00:00
Petr Hosek 8782d22b26 Revert "[CMake][libcxx] Do not rely on the existence of c++abi or unwind targets"
This reverts commit 94fc5a96f58071703d81d14690094dcd266a5e17.

llvm-svn: 291727
2017-01-11 23:56:31 +00:00
Petr Hosek 8c6ac2853d Revert "[CMake][libcxx] Check that we have libcxxabi before using it"
This reverts commit 8c91834411b322ab360eb1f193f489327e719652.

llvm-svn: 291726
2017-01-11 23:56:29 +00:00
Petr Hosek 7e35ee4b8b [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

llvm-svn: 291723
2017-01-11 23:11:40 +00:00
Petr Hosek 777de22120 [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

llvm-svn: 291632
2017-01-11 00:56:10 +00:00
Petr Hosek 1612f8c420 [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

llvm-svn: 291592
2017-01-10 19:51:17 +00:00
Marshall Clow 3a6474ecbb Qualify some type names that I thought were fine, but some of the bots don't like.
llvm-svn: 291580
2017-01-10 18:40:01 +00:00
Marshall Clow dc83e7795f 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.
llvm-svn: 291572
2017-01-10 16:59:33 +00:00
Roger Ferrer Ibanez e8623b90ae 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

llvm-svn: 291550
2017-01-10 08:48:48 +00:00
Saleem Abdulrasool 4ec493b231 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.

llvm-svn: 291536
2017-01-10 04:18:47 +00:00
Bruno Cardoso Lopes d7849a6c83 [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

llvm-svn: 291517
2017-01-10 00:51:02 +00:00
Michal Gorny c3afb8aa3d [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.

llvm-svn: 291508
2017-01-09 23:41:38 +00:00
Justin Bogner 603715c66b 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.

llvm-svn: 291497
2017-01-09 23:07:12 +00:00
Marshall Clow 04b9853a97 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.
llvm-svn: 291492
2017-01-09 22:32:11 +00:00
Dimitry Andric 082fa545cc 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

llvm-svn: 291476
2017-01-09 20:29:35 +00:00
Marshall Clow 6f8e7e0853 Added XFAIL for the apple versions of clang as well
llvm-svn: 291475
2017-01-09 20:29:28 +00:00
Bruno Cardoso Lopes e542373920 [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

llvm-svn: 291466
2017-01-09 19:21:48 +00:00
Marshall Clow 8fd58a6be8 Implement P0403R1 - 'Literal suffixes for basic_string_view'. Requires clang 4.0 (specifically, r290744)
llvm-svn: 291457
2017-01-09 18:07:34 +00:00
Asiri Rathnayake b71c89913c [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.

llvm-svn: 291433
2017-01-09 10:38:56 +00:00
Eric Fiselier 5741d86d11 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.

llvm-svn: 291345
2017-01-07 11:27:06 +00:00
Michael Park f62eb6b29a Added "Michael Park" to `CREDITS.TXT`.
Summary: Test commit + give myself credit.

Reviewers: EricWF

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

llvm-svn: 291344
2017-01-07 10:19:24 +00:00
Eric Fiselier 956604fed5 [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

llvm-svn: 291343
2017-01-07 10:04:40 +00:00
Eric Fiselier 72771139f1 Ensure Sleep(...) isn't passed the value 0 on Windows
llvm-svn: 291342
2017-01-07 09:53:28 +00:00