Commit Graph

2431 Commits

Author SHA1 Message Date
Vasileios Kalintiris
1654db495f Revert "Introduce a cmake module to figure out whether we need to link with libatomic."
This reverts commit r260235. It breaks LLVM's bootstrap when building
with a -gcc-toolchain and the system's gcc installation does not provide
the libatomic library and its headers. We should check whether
LIBCXX_GCC_TOOLCHAIN is set and adjust the flags accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@260323 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 23:38:28 +00:00
Vasileios Kalintiris
b56fdea386 Introduce a cmake module to figure out whether we need to link with libatomic.
Summary:
This fixes the tests under std/atomics for 32-bit MIPS CPUs where the
8-byte atomic operations call into the libatomic library.

Reviewers: dsanders, mclow.lists, EricWF, jroelofs, joerg

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D16613

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@260235 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 17:00:38 +00:00
Marshall Clow
81b46a5bc6 Minor updates to failing tests. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@260202 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 06:38:56 +00:00
Saleem Abdulrasool
f3adaaf5d7 Use the reserved spellings for attributes
Change the no_sanitize attribute to use the reserved spelling.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@260195 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 04:05:37 +00:00
Eric Fiselier
398588caf7 Revert r260012 due to __gnu_cxx::hash_map breakage
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@260172 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-08 23:47:13 +00:00
Marshall Clow
5f3668d142 Clean up a test; get rid of hard-wired char/wchar_t code for template fns that take any char type. Prep work for PR#26503
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@260115 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-08 17:38:23 +00:00
Saleem Abdulrasool
7adfa0328f build: silence warnings in in-tree build
Avoid the developer warnings from cmake when configuring libc++ as part of the
LLVM layout.  Setup the custom macro paths earlier to re-use the detection logic
prior to setting the project properties.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@260071 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-08 03:50:18 +00:00
Eric Fiselier
cf108ebe8c Cleanup node-type handling in the unordered containers
This patch is the first in a series of patches that's meant to better
support unordered_map. unordered_map has a special "value_type" that
differs from pair<const Key, Value>. In order to meet the EmplaceConstructible
and CopyInsertable requirements we need to teach __hash_table about this
special value_type.

This patch creates a "__hash_node_types" traits class that contains
all of the typedefs needed by the unordered containers and it's iterators.
These typedefs include ones for each node type and  node pointer type,
as well as special typedefs for "unordered_map"'s value type.

As a result of this change all of the unordered containers now all support
incomplete types.

As a drive-by fix I changed the difference_type in __hash_table to always
be ptrdiff_t. There is a corresponding change to size_type but it cannot
take affect until an ABI break.

This patch will be followed up shortly with fixes for various unordered_map
fixes.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@260012 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-07 00:36:33 +00:00
Niels Ole Salscheider
c35d862b37 Fix the search path for CMake files
This allows to find the LLVM's CMake files after moving them in
r259821.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@259842 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 23:17:20 +00:00
Duncan P. N. Exon Smith
e784f5770f re.results.form: Format out-of-range subexpression references as null
Rather than crashing in match_results::format() when a reference to a
marked subexpression is out of range, format the subexpression as empty
(i.e., replace it with an empty string).  Note that
match_results::operator[]() has a range-check and returns a null match
in this case, so this just re-uses that logic.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@259682 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-03 19:30:20 +00:00
Alexey Samsonov
d118e3219b [docs] Remove references to autoconf build.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@259281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 01:11:42 +00:00
Ben Craig
8057a58530 [libcxx] Whitelist inclusion of sysctl.h instead of blacklisting
Instead of excluding all known operating systems that are not derived from BSD,
I now include all operating systems that claim to be derived from BSD.
Hopefully, that will make it so that this check doesn't need to change for
every new operating system that comes along.

http://reviews.llvm.org/D16634


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@259193 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 13:53:23 +00:00
Eugene Zelenko
5089530c83 Remove autoconf support.
Differential revision: http://reviews.llvm.org/D16651


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@259091 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 21:00:21 +00:00
Daniel Sanders
9f1188246e [libcxx] Work around for clang calling GAS after having already failed.
Summary:
This is a workaround to a clang bug which causes libcxx tests to fail in the 3.8
release. The clang bug is currently being investigated. It seems that clang
does not stop after frontend errors when using -verify and -fno-integrated-as
(or when this is the default). This patch adds -fsyntax-only to prevent GAS
from being called, fixing the libcxx failures.

PR26277

Patch by Eric Fiselier

Reviewers: mclow.lists, hans, EricWF

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D16584

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@259046 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 13:49:33 +00:00
Akira Hatanaka
ef67e427b5 [libcxx] Remove pragmas that were needed to suppress warnings produced
by -Wpadded.

We don't need these pragmas anymore because -Wpadded was removed from
buildit in r258900.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@259023 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 06:13:36 +00:00
Marshall Clow
b8d4b4c26d Left a file out of r259014
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@259015 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 04:15:35 +00:00
Marshall Clow
40a097dae9 implement ostream_joiner. Reviewed as http://reviews.llvm.org/D16605
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@259014 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 04:14:56 +00:00
Daniel Sanders
0b8b88adef [libcxx] Additional 'REQUIRE' directives for tests that require en_US.UTF-8.
Summary:
These are the tests that didn't fail in the release candidate because they were
covered by another 'REQUIRES' directive.

Reviewers: mclow.lists, hans, bcraig, EricWF

Subscribers: EricWF, dim, cfe-commits

Differential Revision: http://reviews.llvm.org/D16408

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258920 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 10:45:07 +00:00
Akira Hatanaka
82091b205f [libcxx] Remove -Wpadded from buildit script.
Per discussion with Eric and Joerg, this commit removes -Wpadded to
silence the warning about the padding inserted at the tail of struct
_Rep_base.

rdar://problem/23932550


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258900 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 01:55:11 +00:00
Eric Fiselier
c778a6a924 Fix broken commit r258888. I missed adding two pointer conversions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258893 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 00:49:20 +00:00
Eric Fiselier
de637db263 [libcxx] Fix undefined behavior in forward_list
Summary:
This patch is similar to the <list> fix but it has a few differences. This patch doesn't use a `__link_pointer` typedef because we don't need to change the linked list pointers because `forward_list` never stores a  `__forward_begin_node` in the linked list itself. 

The issue with `forward_list` is that the iterators store pointers to `__forward_list_node` and not `__forward_begin_node`. This is incorrect because `before_begin()` and `cbefore_begin()` return iterators that point to a `__forward_begin_node`. This means we incorrectly downcast the `__forward_begin_node` pointer to a `__node_pointer`. This downcast itself is sometimes UB but it cannot be safely removed until ABI v2. The more common cause of UB is when we deference the downcast pointer. (for example `__ptr_->__next_`). This can be fixed without an ABI break by upcasting `__ptr_` before accessing it.

The fix is as follows:

1. Introduce a `__iter_node_pointer` typedef that works  similar to `__link_pointer` in the last patch. In ABI v2 it is always a typedef for `__begin_node_pointer`.
2. Change the `__before_begin()` method to return the correct pointer type (`__begin_node_pointer`),
    Previously it incorrectly downcasted  the  `__forward_begin_node` to a `__node_pointer`  so it could be used to constructor the iterator types.
3. Change `__forward_list_iterator` and `__forward_list_const_iterator`  in the following way:
    1. Change `__node_pointer __ptr_;` member to  have the `__iter_node_pointer` type instead. 
    2. Add additional private constructors that accept `__begin_node_pointer` in addition to `__node_pointer` and then correctly cast them to the stored `__iter_node_pointer` type. 
    3. Add  `__get_begin()` and `__get_node_unchecked()` accessor methods that correctly cast `__ptr_` to the expected pointer type. `__get_begin()` is always safe to use and should be 
       preferred. `__get_node_unchecked()` can only be used on a deferencible iterator.
4. Replace direct access to `__forward_list_iterator::__ptr_`  with the safe accessor methods.
  


Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D15836

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258888 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 00:11:54 +00:00
Eric Fiselier
949215c589 Remove dead code missed in r258852.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258855 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 20:31:01 +00:00
Eric Fiselier
e01f946792 Fix PR26103 - Error calling is_convertible with incomplete type. Patch from Michael Daniels.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258852 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 20:24:30 +00:00
Marshall Clow
73de880a44 Implement LWG#2385; remove the allocator-aware std::function::assign call. It was useless, and didn't actually *do anything* with the allocator. Now it's gone. On the off chance that someone is mistakenly calling it, it's only gone in C++1z
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258697 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 17:29:55 +00:00
Duncan P. N. Exon Smith
005e38f9fb Revert "unordered_map: Reuse insert logic in emplace when possible, NFC"
This reverts commit r258575.  EricWF sent me an email (no link since it
was off-list) requesting to review this pre-commit instead of
post-commit.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258625 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 15:12:47 +00:00
Marshall Clow
cd86b70d14 Fix test to pass in C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258593 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-23 01:02:29 +00:00
Duncan P. N. Exon Smith
9f745c8696 unordered_map: Reuse insert logic in emplace when possible, NFC
An upcoming commit will add an optimization to insert() that avoids
unnecessary mallocs when we can safely extract the key type.  This
commit shares code between emplace() and insert():
- if emplace() is given a single argument, and
- value_type is constructible from that argument
so that we have a single code path for the two.

I also updated the debug version of emplace_hint() to defer to
emplace(), like the non-debug version does.

In both cases, there should be NFC here.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 22:48:02 +00:00
Duncan P. N. Exon Smith
9572235332 unordered: Rename __construct_node_hash() to allow forwarding, NFC
Rename the version of __construct_node() that takes a hash as an
argument to __construct_node_hash(), and use perfect-forwarding when
Rvalue references are available.  The primary motivation is to allow
other types through, since unordered_map's value_type is different from
__hash_table's value_type -- a follow-up will take advantage of this --
but the rename is general "goodness".

There should be no functionality change here (aside from enabling the
follow-up).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258511 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 18:27:26 +00:00
Eric Fiselier
219d4efd34 Add __uncvref type for use in later patches
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258491 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 06:25:47 +00:00
Marshall Clow
7a7960ff7f Implement LWG#2101 'Some transformation types can produce impossible types' Introduced a new (internal) type trait '__is_referenceable' with tests. Use that trait in add_lvalue_reference, add_rvalue_reference and add_pointer.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-21 18:22:43 +00:00
Daniel Sanders
cd17b3b156 [libcxx] Add appropriate 'REQUIRE' directives to tests that require en_US.UTF-8.
Reviewers: mclow.lists, hans

Subscribers: bcraig, cfe-commits

Differential Revision: http://reviews.llvm.org/D16406

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258403 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-21 15:35:15 +00:00
Eric Fiselier
2edcac4d39 Use TEST_STD_VER instead of __has_feature to detect noexcept. This fixes the test with GCC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258292 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 05:44:11 +00:00
Marshall Clow
f90978aa1a More string fixes for noexcept cases. Apparently I didn't get them all in r258281.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258291 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 05:41:24 +00:00
Eric Fiselier
c8b24c6d54 Mark some test XFAIL for GCC 4.9 due to missing is_trivial* traits
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258287 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 04:59:57 +00:00
Marshall Clow
b8f31a1c14 Got the test backwards in r258279. Fixed that and de-tabbed
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 03:37:46 +00:00
Marshall Clow
85d4c2a93f Fix up the tests I added for string exceptions to be skipped when exceptions are disabled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258279 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 03:19:15 +00:00
Eric Fiselier
14a9008568 Add link to 3rd party GDB pretty-printers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258270 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 01:26:30 +00:00
Eric Fiselier
1c7fb8147e Fix enviroment variables when running shell scripts
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258217 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 23:06:29 +00:00
Eric Fiselier
a9e91f30ee Add more missing license headers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258198 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 21:58:49 +00:00
Eric Fiselier
fa1e5db3bc Add missing license headers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 21:52:04 +00:00
Eric Fiselier
e3bf91abf6 Mark slow ASAN/MSAN tests as XFAIL for now.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258195 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 21:51:07 +00:00
Marshall Clow
685cdcaf9f Fix PR#26175. Thanks to Josh Petrie for the report and the patch. Reviewed as http://reviews.llvm.org/D16262
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258107 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 00:50:37 +00:00
Jonathan Roelofs
90a7bf9194 Tame a -Wunknown-attributes warning
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@257707 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 23:27:08 +00:00
Marshall Clow
7d9888365a Better comments in test. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@257702 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 23:05:15 +00:00
Marshall Clow
2dceed874d Fix test for C++03 - lacking noexcept
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@257696 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 22:52:36 +00:00
Marshall Clow
df9db31c27 Fix PR#25973 : 'basic_string::assign(InputIt, InputIt) doesn't provide the strong exception safety guarantee'. This turned out to be a pervasive problem in <string>, which required a fair amount of rework. Add in an optimization for when iterators provide noexcept increment/comparison/assignment/dereference (which covers many of the iterators in libc++). Reviewed as http://reviews.llvm.org/D15862
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@257682 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 21:54:34 +00:00
Hans Wennborg
b27535c0c3 Update version to 3.9
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@257629 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 17:33:21 +00:00
Dan Gohman
2afbf71fdd [WebAssembly] Set std::numeric_limits's traps field for WebAssembly.
WebAssembly's integer division instruction traps on division by zero; set the
traps field of integral std::numeric_limits to true.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@257612 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 16:32:00 +00:00
Marshall Clow
4f4a07d66a One more missing std:: qualification from Jonathan
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@257506 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 19:15:10 +00:00
Marshall Clow
e5e9bff62a Add a bunch of missing includes in the test suite to make it more portable. Fixes bugs #26120 and #26121. Thanks to Jonathan Wakely for the reports and the patches.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@257474 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 14:51:04 +00:00