Commit Graph

4099 Commits

Author SHA1 Message Date
Marshall Clow
d5854559eb Update a couple of issue statuses
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295355 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-16 18:50:30 +00:00
Saleem Abdulrasool
af5f91fd19 math: correct the MSVCRT condition
Fixes a number of tests in the testsuite on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295330 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-16 15:47:50 +00:00
Saleem Abdulrasool
e80bd1ab0b threading_support: make __thread_sleep_for be alertable
On Windows, we were using `Sleep` which is not alertable.  This means
that if the thread was used for a user APC or WinProc handling and
thread::sleep was used, we could potentially dead lock.  Use `SleepEx`
with an alertable sleep, resuming until the time has expired if we are
awoken early.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295329 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-16 15:47:45 +00:00
Eric Fiselier
2c477cb41a Add tests for noexcept functions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294995 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13 22:44:39 +00:00
Saleem Abdulrasool
5748d2b404 config: disable thread safety analysis on COFF
clang cannot properly handle __declspec and __attribute__ on classes
right now.  This prevents the shared_mutex tests from working.  Disable
the use of the annotation on COFF targets.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294958 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13 15:26:51 +00:00
Saleem Abdulrasool
766ba68107 math: actually pull the declarations/overloads into std
The previous changes missed the change to include/cmath.  These changes
allow some of the rand.distribution tests to pass on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294957 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13 15:26:50 +00:00
Saleem Abdulrasool
7f5b63b5c4 test: mark another test as requiring pthreads
This is checking pthread specific behaviour.  Add a requirement on
pthreads.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294956 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13 15:26:47 +00:00
Saleem Abdulrasool
bacb35f5ae math: follow up to SVN r294902
Pull in the math functions from ucrt 14+ after auditing the library.  It
seems that they are now complete for C99 math.  Fixes more windows
tests!

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294918 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 21:42:37 +00:00
Saleem Abdulrasool
bd18417b4d test: use char32_t rather than wchar_t
wchar_t is not as portable as char32_t.  On Windows, wchar_t is
16-bytes and on Linux 32-bits.  The conversion to utf8 causes the
characters to exceed the limits on char16_t, resulting in tautological
comparisons.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294917 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 21:42:35 +00:00
Saleem Abdulrasool
effe3dc412 test: mark requirement for pthread test
This test explicitly is checking the behaviour of std::thread and
pthread interactions.  This requires pthreads.  Add an appropriate
requirement.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294903 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 17:37:48 +00:00
Saleem Abdulrasool
be3d93ca48 math: pull more C functions from std
The newer ucrt version provides the gamma meth routines.  Includede them
when building the library.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294902 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 17:37:45 +00:00
Saleem Abdulrasool
0849d28af1 test: squelch -Wreturn-type error
Add an unreachable marker to avoid a -Wreturn-type error when building
on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294901 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 17:37:44 +00:00
Saleem Abdulrasool
430800ddb8 cmath: adjust math forwards for Windows
The newer versions of ucrt have the math routines.  Use the CRT version
to determine if we should include the math routines.  Fixes two tests
for Windows.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294899 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 16:44:17 +00:00
Ed Schouten
c253e58209 Remove a now unneeded __CloudABI__ check.
CloudABI has gained the setlocale() function in the meantime, meaning
there is no longer a need to conditionalize this.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294833 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 08:33:16 +00:00
Ed Schouten
ff5eeb6bee Fix the build of thread.cpp on CloudABI.
CloudABI does provide unistd.h, but doesn't define __unix__. We need to
include this header file to make hardware_concurrency work.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294832 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 08:30:18 +00:00
Marshall Clow
197b8821c6 Fix a bug I introduced in the tests for experimental::lcm and experimental::gcd.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294798 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 22:44:14 +00:00
Marshall Clow
ebf66a385f Make lcm/gcd work better in edge cases. Fixes a UBSAN failure.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294779 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 20:49:08 +00:00
Eric Fiselier
00d9a944af Fix yet another Apple buildit bug
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294732 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 09:25:15 +00:00
Eric Fiselier
f2dbd02b30 Attempt to fix Apple buildit bots
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294731 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 09:16:29 +00:00
Eric Fiselier
1edf3166ef Recommit "Split exception.cpp and new.cpp implementation into different files for different runtimes."
This recommits r294707 with additional fixes. The main difference is
libc++ now correctly builds without any ABI library.

exception.cpp is a bloody mess. It's full of confusing #ifdef branches for
each different ABI library we support, and it's getting unmaintainable.

This patch breaks down exception.cpp into multiple different header files,
roughly one per implementation. Additionally it moves the definitions of
exceptions in new.cpp into the correct implementation header.

This patch also removes an unmaintained libc++abi configuration.
This configuration may still be used by Apple internally but there
are no other possible users. If it turns out that Apple still uses
this configuration internally I will re-add it in a later commit.
See http://llvm.org/PR31904.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294730 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 08:57:35 +00:00
Eric Fiselier
d3298ad74e Revert "Split exception.cpp and new.cpp implementation into different files for different runtimes."
The compiler-rt CMake configuration needs some tweaking before this can land.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294727 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 07:43:08 +00:00
Eric Fiselier
e1b6382ee3 Properly escape ShellTest subsitutions on Windows. Try 2
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294721 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 06:59:07 +00:00
Saleem Abdulrasool
4aac249f71 test: XFAIL windows for non-portable test
This test validates that the lock_guard is declared variadically across
C++03 and C++11.  Given the lack of stable ABI on Windows and the fact
that the RTTI encoding on Windows is different, XFAIL it on that target.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294720 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 06:51:21 +00:00
Saleem Abdulrasool
74ec9d7947 test: fix test under Windows
When running the test under clang-cl, we do not report `__GNUC__`, which
is needed to supress the warnings which are being treated as errors.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294719 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 06:51:19 +00:00
Eric Fiselier
f3078f63a9 properly escape compiler path in .sh.cpp tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294718 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 06:38:02 +00:00
Saleem Abdulrasool
b9eccbec08 test: allow -target usage on Windows
When running the tests on Windows with a debug build, _DEBUG must be
added to the flags prior to the -target as the forced inclusion of a
header will prevent the compile test for the flag to fail.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294716 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 06:24:34 +00:00
Eric Fiselier
801e00b0cd Correctly default to using the system libc++abi on Apple.
This patch fixes a regression where libc++ didn't correctly
select the system libc++abi when no in-tree version was found.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294712 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 05:07:03 +00:00
Eric Fiselier
d60b66ad4f Split exception.cpp and new.cpp implementation into different files for different runtimes.
exception.cpp is a bloody mess. It's full of confusing #ifdef branches for
each different ABI library we support, and it's getting unmaintainable.

This patch breaks down exception.cpp into multiple different header files,
roughly one per implementation. Additionally it moves the definitions of
exceptions in new.cpp into the correct implementation header.

This patch also removes an unmaintained libc++abi configuration.
This configuration may still be used by Apple internally but there
are no other possible users. If it turns out that Apple still uses
this configuration internally I will re-add it in a later commit.
See http://llvm.org/PR31904.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294707 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 04:25:33 +00:00
Saleem Abdulrasool
e7bee0d9c6 docs: add some documentation for building on Windows
This covers how to build libc++ for Windows.  This allows others to
replicate the MS ABI style build for libc++.  It only depends on msvcrt
as it uses the Windows threading model and the Windows ABI and can serve
as an ABI compatible replacement for msvcprt.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294705 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 03:58:20 +00:00
Eric Fiselier
4fd0d50a96 Attempt to fix finding clang++ on Windows
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294699 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 03:20:02 +00:00
Saleem Abdulrasool
29e1142d8b __threading_support: fix windows build
The build was broken as there was no overload for long and
std::chrono::nanoseconds.  Add an explicit conversion to use the
operator+.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294698 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 02:49:52 +00:00
Mehdi Amini
7666130d06 Fully qualify (preprend ::) calls to math functions from libc
Summary:
This can cause a compile failure in cases like:

double log(double);
namespace foo {
  namespace log {}
}
using namespace foo;
void bar(int i) {
  log((double)i);
}

Reviewers: EricWF, mclow.lists

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294696 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 02:44:23 +00:00
David L. Jones
917331c88b Check for musl-libc's max_align_t in addition to other variants.
Summary:
Libcxx will define its own max_align_t when it is not available. However, the
availability checks today only check for Clang's definition and GCC's
definition. In particular, it does not check for musl's definition, which is the
same as GCC's but guarded with a different macro.

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: chandlerc, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294683 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 01:27:42 +00:00
Eric Fiselier
7be9c9ae5c Add missing libc++ import
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294673 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 00:01:01 +00:00
Eric Fiselier
5115d24d2c add missing python import
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294660 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 23:29:08 +00:00
Eric Fiselier
ed803866ea Move libcxx/test/libcxx python package into libcxx/utils/libcxx.
This patch merges the test python package with the newly
created package in utils.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294651 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 23:18:11 +00:00
Eric Fiselier
1147753b1c Start libc++ python cleanup and consolidation.
Libc++ frequently creates and uses utilities written in python.
Currently there are python modules under both libcxx/test and
libcxx/util. My goal with these changes is to consolidate them
into a single package under libcxx/utils/libcxx.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294644 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 22:53:14 +00:00
Eric Fiselier
d8b62dceb2 Fix PR31916 - std::visit rejects visitors accepting lvalue arguments
A static assertion was misfiring since it checked
is_callable<Visitor, decltype(__variant_alt<T>.value)>. However
the decltype expression doesn't capture the value category as
required. This patch applies extra braces to decltype to fix
that.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294612 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 19:01:22 +00:00
Joerg Sonnenberger
5a0c9c3d7a Use protected name for the prototype arguments.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294585 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 14:12:29 +00:00
Asiri Rathnayake
1b93961586 Threading support: externalize sleep_for() function.
Different platforms implement the wait/sleep functions in difrerent ways.
It makes sense to externalize this into the threading API.

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

Reviewers: EricWF, joerg

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294573 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 09:31:41 +00:00
Petr Hosek
f4699a5b99 [libcxx][CMake] Support in-tree libunwind when building as part of runtimes
When building as part of runtimes, there is no predefined order in
which the runtimes are loaded, so the targets from other projects
might not be available. We need to rely on HAVE_<name> variables
instead in that case.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294553 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 02:19:43 +00:00
Eric Fiselier
59955033d2 Update info for LWG 2665 in upcoming_meeting.html
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294501 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-08 19:04:18 +00:00
Michal Gorny
6c7c93f95a [test] Fix hard_link_count test to account for fs with dir nlink==1
Filesystems are not required to maintain a hard link count consistent
with number of subdirectories. For example, on btrfs all directories
have nlink==1. Account for that in the test.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294431 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-08 09:57:32 +00:00
Marshall Clow
1b8fc14abc Temporarily disable the LCM/GCD tests under UBSAN.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294417 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-08 07:40:59 +00:00
Eric Fiselier
34da9b5d09 Add missing include in <numeric>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294393 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-08 00:14:13 +00:00
Eric Fiselier
25f28d0c9e Prevent UBSAN from generating unsigned overflow diagnostics in the hashing internals
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294391 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-08 00:10:10 +00:00
Eric Fiselier
fecf057940 Fix bugs in filesystem detected by _LIBCPP_ASSERT.
Recently I turned on libc++'s debug mode assertions when
CMake is configured with -DLIBCXX_ENABLE_ASSERTIONS=ON. This
change exposed assertion failures caused by bugs in filesystem.
This patch fixes those failures.

The first bug was that `PathParser` was using front()/back()
on empty string views in order to get the address of the character.
However this is UB on empty strings. Those operations now use data()
to obtain the pointer.

The second bug was that directory_iterator attempted to capture errno when it
was unset and there was an assertion to detect this.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294360 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-07 21:51:58 +00:00
Eric Fiselier
2b495bd9d7 fix python3 syntax error
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294355 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-07 21:21:17 +00:00
Eric Fiselier
cd4ab9c404 Fix test failures when using modules.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294353 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-07 21:20:31 +00:00
Dan Albert
5a78d25b71 Use copy.deepcopy instead of doing it manually.
Reviewers: EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294350 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-07 21:04:19 +00:00