Commit Graph

5355 Commits

Author SHA1 Message Date
Louis Dionne fc778fa2c5 [libc++] Remove old CMake workaround
We haven't had any complaints so far, and I don't think anybody builds
libc++ from source for that old platform anymore.

llvm-svn: 355336
2019-03-04 20:52:14 +00:00
Eric Fiselier 8b73ab29c3 Install GCC 5 on buildbots to replace GCC 4.9.
LLVM is dropping support for GCC 4.9. This patch adds
a GCC 5 installation to the buildbot image so we can upgrade
the 4.9 bot to GCC 5.

As a temporary workaround until zorg updates, we install GCC 5
as GCC 4.9.

llvm-svn: 355334
2019-03-04 20:49:18 +00:00
Louis Dionne 21450545d1 [libc++] decoupling Freestanding atomic<T> from libatomic.a
This patch introduces non-lockfree atomics that do not require using
an external libatomic. This work is done with the long-term goal of
allowing the use of <atomic> in freestanding environments.

Thanks to Olivier Giroux for the patch.
Differential Revision: https://reviews.llvm.org/D56913

llvm-svn: 355318
2019-03-04 15:26:27 +00:00
Louis Dionne afde07ce97 [libc++] Fix forgotten fclose() in unit test
Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D58732

llvm-svn: 355162
2019-03-01 01:32:44 +00:00
Louis Dionne e90085029c [libc++] Increase portability of xalloc test
Do not assume that xalloc() starts at 0, which is not specified by the
Standard.

Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D58299

llvm-svn: 355160
2019-03-01 00:51:54 +00:00
Louis Dionne 4fcdf21406 [NFC][libc++] Update comment about oldest supported macosx for back-deployment
llvm-svn: 355043
2019-02-27 23:36:22 +00:00
Louis Dionne ab19068b7f [libc++] Add is_nothrow_convertible from P0758R1
Reviewed as https://reviews.llvm.org/D58019.
Thanks to Zoe Carver for the patch.

llvm-svn: 355010
2019-02-27 17:57:38 +00:00
Louis Dionne 1be935f418 [libc++] Remove visibility-related warnings with Clang 8
The attributes were placed incorrectly -- they need to be after the
"struct" keyword, not before.

llvm-svn: 355006
2019-02-27 17:33:25 +00:00
Marshall Clow 5c814099c7 I changed a 'enable_if<...>::type to' 'enable_if_t<...>' but forgot to remove the preceding 'typename'
llvm-svn: 354995
2019-02-27 16:09:35 +00:00
Marshall Clow 02e1651c1f Implment the last part of P1024: tuple-like interface to span. Reviewed as https://reviews.llvm.org/D58706.
llvm-svn: 354988
2019-02-27 15:41:37 +00:00
Marshall Clow 2ffa170515 In the review of D58642, Louis asked: 'Is there a reason for making this inline? Templates are already inline by default'. I told him that I didn't want to change the one call (ssize) that I was adding, but would come back later and clean them all (data/empty/begin/end/cbegin/cend/rbegin/rend/crbegin/crend/size/ssize) up later. Now it is later. Remove the unnecessary 'inline' modifiers from all these calls.
llvm-svn: 354952
2019-02-27 03:25:43 +00:00
Marshall Clow 7d3986ea30 Implement the second part of P1227R2 - Signed ssize() functions. Reviewed as https://reviews.llvm.org/D58642
llvm-svn: 354950
2019-02-27 02:58:56 +00:00
Marshall Clow ded9f0efad Fix an ambiguity in the tests that gcc-tot complained about.
llvm-svn: 354944
2019-02-27 01:29:52 +00:00
Louis Dionne 62f3900715 [libc++] Add a test for PR14074
PR14074 was fixed in r165884, but no tests were added.

llvm-svn: 354943
2019-02-27 01:29:09 +00:00
Louis Dionne 25838c6dac [libc++] Mark several tests as XFAIL on macosx10.7
Those tests fail when linking against a new dylib but running against
macosx10.7. I believe this is caused by a duplicate definition of the
RTTI for exception classes in libc++.dylib and libc++abi.dylib, but
this matter still needs some investigation.

This issue was not caught previously because all the tests always linked
against the same dylib used for running (because LIT made it impossible
to do otherwise before r349171).

rdar://problem/46809586

llvm-svn: 354940
2019-02-27 00:57:57 +00:00
Marshall Clow 7ad06a9319 First part of P1227R2 - change span over to use 'size_t' instead of 'ptrdiff_t'. Reviewed as https://reviews.llvm.org/D58639.
llvm-svn: 354936
2019-02-27 00:32:16 +00:00
Louis Dionne 27f79151ec [libc++] Add <filesystem> to the min-mac macro header test
llvm-svn: 354932
2019-02-26 23:14:58 +00:00
Marshall Clow c0170de222 Remove P1272R1, it was not moved in Kona
llvm-svn: 354904
2019-02-26 18:17:30 +00:00
Marshall Clow a04143ee27 Put a 'first implemented' version into the entry for P1357
llvm-svn: 354901
2019-02-26 17:22:47 +00:00
Marshall Clow 7b4ab3b9e4 Mark several issues (and one paper) as complete. Reviewed as D58099; but I added LWG3101 and LWG3144 and P1357R1 as well.
llvm-svn: 354898
2019-02-26 17:01:00 +00:00
Marshall Clow 46c719ddcd Implement P1357: Traits for [Un]bounded Arrays; adopted in Kona
llvm-svn: 354891
2019-02-26 16:07:03 +00:00
Louis Dionne 5d79eaa82f [libc++] Rename _NOALIAS macro to _LIBCPP_NOALIAS
Summary:
For consistency, libc++ macros always start with _LIBCPP. This should
have no functionality change.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

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

llvm-svn: 354848
2019-02-26 06:34:42 +00:00
Marshall Clow 310b75e519 LWG3101 - span's Container constructors need another constraint. Reviewed as https://reviews.llvm.org/D57058.
llvm-svn: 354805
2019-02-25 18:32:57 +00:00
Marshall Clow 4fd0395477 Commit LWG3144 - span does not have a const_pointer typedef. Reviewed as D57039.
llvm-svn: 354802
2019-02-25 17:58:03 +00:00
Marshall Clow 9ab85a69dc First part of P1024: Usability Enhancements for std::span. Remove operator() for indexing, and add 'front' and 'back' calls.
llvm-svn: 354801
2019-02-25 17:54:08 +00:00
Marshall Clow 8a7f4c9891 Update status page with papers/issues adopted in Kona
llvm-svn: 354796
2019-02-25 16:12:00 +00:00
Louis Dionne 73be0cb773 [libcxx] Make sure all experimental tests are disabled when enable_experimental=False
Summary:
Previously, we'd run some experimental tests even when enable_experimental=False
was used with lit.

Reviewers: EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits, mclow.lists

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

llvm-svn: 354725
2019-02-23 11:24:03 +00:00
Louis Dionne 431cfbf172 [NFC] Fix incorrect comment in std::function test
llvm-svn: 354537
2019-02-21 00:53:26 +00:00
Dimitry Andric d95da99b91 Fix the build with gcc when `-Wredundant-decls` is passed
Summary:
gcc warns that `__throw_runtime_error` is declared both in `<__locale>`
and `<stdexcept>`, if `-Wredundant-decls` is passed on the command
line; this is the case with FreeBSD when ${WARNS} == 6.

Since `<__locale>` gets its first declaration via a transitive include
of `<stdexcept>`, and the second declaration is after the first
invocation of `__throw_runtime_error`, delete that second declaration.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>

Reviewers: kristina, MaskRay, EricWF, ldionne, ngie

Reviewed By: EricWF

Subscribers: krytarowski, brooks, emaste, dim, christof, jdoerfert, libcxx-commits

Tags: #libc

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

llvm-svn: 354515
2019-02-20 21:01:31 +00:00
Jonas Hahnfeld 66c60d9d71 [compiler-rt] Build custom libcxx with libcxxabi
This changes add_custom_libcxx to also build libcxxabi and merges
the two into a static and hermetic library.
There are multiple advantages:
1) The resulting libFuzzer doesn't expose C++ internals and looks
   like a plain C library.
2) We don't have to manually link in libstdc++ to provide cxxabi.
3) The sanitizer tests cannot interfere with an installed version
   of libc++.so in LD_LIBRARY_PATH.

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

llvm-svn: 354212
2019-02-17 12:16:20 +00:00
Louis Dionne 95601bdd29 [libcxx] Do not assume the number of elements in a moved-from associative container
Reviewed as https://reviews.llvm.org/D57903.
Thanks to Andrey Maksimov for the patch.

llvm-svn: 353955
2019-02-13 16:43:44 +00:00
Louis Dionne 7232a84e68 [libc++] Avoid UB in the no-exceptions mode in a few places
Summary:
A few places in the library seem to behave unexpectedly when the library
is compiled or used with exceptions disabled. For example, not throwing
an exception when a pointer is NULL can lead us to dereference the pointer
later on, which is UB. This patch fixes such occurences.

It's hard to tell whether there are other places where the no-exceptions
mode misbehaves like this, because the replacement for throwing an
exception does not always seem to be abort()ing, but at least this
patch will improve the situation somewhat.

See http://lists.llvm.org/pipermail/libcxx-dev/2019-January/000172.html

Reviewers: mclow.lists, EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

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

llvm-svn: 353850
2019-02-12 16:06:02 +00:00
Petr Hosek 5300d84116 [CMake] Avoid passing -rtlib=compiler-rt when using compiler-rt
We build libc++ and libc++abi with -nodefaultlibs, so -rtlib=compiler-rt
has no effect and results in an 'argument unused during compilation'
warning which breaks the build when using -Werror. We can therefore drop
-rtlib=compiler-rt without any functional change; note that the actual
compiler-rt linking is handled by HandleCompilerRT.

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

llvm-svn: 353786
2019-02-12 01:35:29 +00:00
Eric Fiselier 9ebc9dbd3c Don't declare fenv.h functions when they're a macro.
libc still provides function declarations, and these declarations
conflict with libc++'s

llvm-svn: 353774
2019-02-12 00:05:14 +00:00
Eric Fiselier 1eb19e5277 Make the sym_diff utilities more useful.
In particular when working with static libraries and libstdc++.

llvm-svn: 353772
2019-02-12 00:00:43 +00:00
Eric Fiselier cf39dd44b8 Add fenv.h header
Summary:
Some implementations of fenv.h use macros to define the functions they provide. This can cause problems when `std::fegetround()` is spelled in source.

This patch adds a `fenv.h` header to libc++ for the sole purpose of turning those macros into real functions.

Reviewers: rsmith, mclow.lists, ldionne

Reviewed By: rsmith

Subscribers: mgorny, christof, libcxx-commits

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

llvm-svn: 353767
2019-02-11 23:47:19 +00:00
Petr Hosek 1405ac457b [libcxx] Preserve order, avoid duplicates when merging static archives
glob can return files in arbitrary order which breaks deterministic
builds. Rather, use `ar t` to list the files in each archive and
preserve the original order. Using `ar q` results in duplicate entries
in the archive, instead use `ar r` to avoid duplicates.

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

llvm-svn: 353671
2019-02-11 08:48:47 +00:00
Chandler Carruth 9d610c5a53 The new file header didn't get carried over when these files were
"moved" somehow, update them to use it.

llvm-svn: 353669
2019-02-11 08:39:23 +00:00
Chandler Carruth a20f61106b Update some newly added files that mistakenly used the old file header
to the new one.

llvm-svn: 353668
2019-02-11 08:39:14 +00:00
Eric Fiselier e8adbae00a fix -Wextra-semi warnings
llvm-svn: 353650
2019-02-10 18:29:00 +00:00
Eric Fiselier 9d487c7d1e Make LIBCXX_STANDARD_VER configurable
llvm-svn: 353649
2019-02-10 18:27:55 +00:00
Eric Fiselier 609d676aab Format sym_extract.py output to minimize diff output.
Different versions of python print dictionaries in different orders.
 This can mess up diffs when updating ABI lists. This patch uses
 pprint.pformat to print the dicts to get a consistent ordering.

llvm-svn: 353634
2019-02-10 04:48:54 +00:00
Eric Fiselier 17f9331339 Add missing symbols to Apple v2 abi list.
The itoa symbols were added and their addition is documented in the CHANGELOG.
I'm not sure why the valarray symbols were missing previously, but they're
present in the v1 ABI lists and should be here as well.

llvm-svn: 353633
2019-02-10 04:41:48 +00:00
Eric Fiselier 7cddb68292 Add ABI list directories for 8.0
llvm-svn: 353632
2019-02-10 04:09:46 +00:00
Kamil Rytarowski 61113341f7 Mark another test as flaky
Reported on the NetBSD buildbot.

llvm-svn: 353622
2019-02-09 18:39:07 +00:00
Petr Hosek b34fed1a2e [libcxx] Support runtimes and monorepo locations for tests
The test configuration support currently searches for libc++ sources
in <ROOT>/projects/libcxx. This change also additionally searches
<ROOT>/runtimes/libcxx (so called runtimes layout) and <ROOT>/libcxx
(monorepo layout).

This matches the logic we already use in CMake, for example:
https://github.com/llvm/llvm-project/blob/6fd4e7f/libcxx/CMakeLists.txt#L148

When the monorepo becomes the only supported layout in the future,
we can simplify this logic again.

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

llvm-svn: 353600
2019-02-09 02:50:09 +00:00
Marshall Clow aa09911aef Add static_asserts to tuple's comparison operators to enforce the requirement that the tuples be the same size. See PR39183 for an example where we give unexpected results for this bad input case. With this change, we will reject it at compile-time
llvm-svn: 353450
2019-02-07 19:03:48 +00:00
Marshall Clow 954966c1af Add UBSAN annotation to __hash_table::rehash; we don't do anything wrong, but UBSAN's checker flags it as suspicious. See PR38606. NFC
llvm-svn: 353448
2019-02-07 18:53:58 +00:00
Louis Dionne feeedafd28 Revert "[libc++] Only add dylib-related features when using the system's libc++"
This reverts r353319, which broke our internal CI.

llvm-svn: 353321
2019-02-06 18:33:02 +00:00
Louis Dionne 6f6beae627 [libc++] Only add dylib-related features when using the system's libc++
Otherwise, when testing trunk libc++ on an older system, lit will think
that the dylib features are disabled. Ideally, we'd have a notion of
running the tests with/without a deployment target (or, equivalently,
a deployment target representing trunk where everything is as recent
as can be). Since we always have a deployment target right now (which
defaults to the current system), we only enable those features when
we're going to also be testing with the system libc++.

llvm-svn: 353319
2019-02-06 18:06:50 +00:00