summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
...
* Cleanup node-type handling in the unordered containersEric Fiselier2016-02-079-71/+558
| | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 260012
* Fix the search path for CMake filesNiels Ole Salscheider2016-02-041-1/+1
| | | | | | | This allows to find the LLVM's CMake files after moving them in r259821. llvm-svn: 259842
* re.results.form: Format out-of-range subexpression references as nullDuncan P. N. Exon Smith2016-02-032-4/+56
| | | | | | | | | | 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. llvm-svn: 259682
* [docs] Remove references to autoconf build.Alexey Samsonov2016-01-301-2/+1
| | | | llvm-svn: 259281
* [libcxx] Whitelist inclusion of sysctl.h instead of blacklistingBen Craig2016-01-291-3/+8
| | | | | | | | | | | 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 llvm-svn: 259193
* Remove autoconf support.Eugene Zelenko2016-01-281-56/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16651 llvm-svn: 259091
* [libcxx] Work around for clang calling GAS after having already failed.Daniel Sanders2016-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 259046
* [libcxx] Remove pragmas that were needed to suppress warnings producedAkira Hatanaka2016-01-282-27/+0
| | | | | | | | | by -Wpadded. We don't need these pragmas anymore because -Wpadded was removed from buildit in r258900. llvm-svn: 259023
* Left a file out of r259014Marshall Clow2016-01-281-0/+114
| | | | llvm-svn: 259015
* implement ostream_joiner. Reviewed as http://reviews.llvm.org/D16605Marshall Clow2016-01-287-0/+381
| | | | llvm-svn: 259014
* [libcxx] Additional 'REQUIRE' directives for tests that require en_US.UTF-8.Daniel Sanders2016-01-277-0/+14
| | | | | | | | | | | | | | 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 llvm-svn: 258920
* [libcxx] Remove -Wpadded from buildit script.Akira Hatanaka2016-01-271-1/+1
| | | | | | | | | | 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 llvm-svn: 258900
* Fix broken commit r258888. I missed adding two pointer conversionsEric Fiselier2016-01-271-2/+2
| | | | llvm-svn: 258893
* [libcxx] Fix undefined behavior in forward_listEric Fiselier2016-01-273-73/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 258888
* Remove dead code missed in r258852.Eric Fiselier2016-01-261-6/+0
| | | | llvm-svn: 258855
* Fix PR26103 - Error calling is_convertible with incomplete type. Patch from ↵Eric Fiselier2016-01-262-2/+9
| | | | | | Michael Daniels. llvm-svn: 258852
* Implement LWG#2385; remove the allocator-aware std::function::assign call. ↵Marshall Clow2016-01-253-4/+11
| | | | | | 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 llvm-svn: 258697
* Revert "unordered_map: Reuse insert logic in emplace when possible, NFC"Duncan P. N. Exon Smith2016-01-231-27/+3
| | | | | | | | 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. llvm-svn: 258625
* Fix test to pass in C++03Marshall Clow2016-01-231-16/+51
| | | | llvm-svn: 258593
* unordered_map: Reuse insert logic in emplace when possible, NFCDuncan P. N. Exon Smith2016-01-221-3/+27
| | | | | | | | | | | | | | | | 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. llvm-svn: 258575
* unordered: Rename __construct_node_hash() to allow forwarding, NFCDuncan P. N. Exon Smith2016-01-221-8/+10
| | | | | | | | | | | | | | 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). llvm-svn: 258511
* Add __uncvref type for use in later patchesEric Fiselier2016-01-221-0/+7
| | | | llvm-svn: 258491
* Implement LWG#2101 'Some transformation types can produce impossible types' ↵Marshall Clow2016-01-218-27/+320
| | | | | | Introduced a new (internal) type trait '__is_referenceable' with tests. Use that trait in add_lvalue_reference, add_rvalue_reference and add_pointer. llvm-svn: 258418
* [libcxx] Add appropriate 'REQUIRE' directives to tests that require en_US.UTF-8.Daniel Sanders2016-01-2124-1/+48
| | | | | | | | | | Reviewers: mclow.lists, hans Subscribers: bcraig, cfe-commits Differential Revision: http://reviews.llvm.org/D16406 llvm-svn: 258403
* Use TEST_STD_VER instead of __has_feature to detect noexcept. This fixes the ↵Eric Fiselier2016-01-201-2/+3
| | | | | | test with GCC. llvm-svn: 258292
* More string fixes for noexcept cases. Apparently I didn't get them all in ↵Marshall Clow2016-01-205-1/+9
| | | | | | r258281. llvm-svn: 258291
* Mark some test XFAIL for GCC 4.9 due to missing is_trivial* traitsEric Fiselier2016-01-2012-3/+39
| | | | llvm-svn: 258287
* Got the test backwards in r258279. Fixed that and de-tabbedMarshall Clow2016-01-201-166/+166
| | | | llvm-svn: 258281
* Fix up the tests I added for string exceptions to be skipped when exceptions ↵Marshall Clow2016-01-205-0/+29
| | | | | | are disabled llvm-svn: 258279
* Add link to 3rd party GDB pretty-printersEric Fiselier2016-01-201-0/+13
| | | | llvm-svn: 258270
* Fix enviroment variables when running shell scriptsEric Fiselier2016-01-191-1/+1
| | | | llvm-svn: 258217
* Add more missing license headersEric Fiselier2016-01-1911-0/+95
| | | | llvm-svn: 258198
* Add missing license headersEric Fiselier2016-01-1917-0/+148
| | | | llvm-svn: 258196
* Mark slow ASAN/MSAN tests as XFAIL for now.Eric Fiselier2016-01-193-0/+10
| | | | llvm-svn: 258195
* Fix PR#26175. Thanks to Josh Petrie for the report and the patch. Reviewed ↵Marshall Clow2016-01-192-0/+4
| | | | | | as http://reviews.llvm.org/D16262 llvm-svn: 258107
* Tame a -Wunknown-attributes warningJonathan Roelofs2016-01-131-1/+1
| | | | llvm-svn: 257707
* Better comments in test. NFCMarshall Clow2016-01-131-2/+3
| | | | llvm-svn: 257702
* Fix test for C++03 - lacking noexceptMarshall Clow2016-01-131-0/+4
| | | | llvm-svn: 257696
* Fix PR#25973 : 'basic_string::assign(InputIt, InputIt) doesn't provide the ↵Marshall Clow2016-01-1343-112/+771
| | | | | | 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 llvm-svn: 257682
* Update version to 3.9Hans Wennborg2016-01-131-1/+1
| | | | llvm-svn: 257629
* [WebAssembly] Set std::numeric_limits's traps field for WebAssembly.Dan Gohman2016-01-132-2/+4
| | | | | | | WebAssembly's integer division instruction traps on division by zero; set the traps field of integral std::numeric_limits to true. llvm-svn: 257612
* One more missing std:: qualification from JonathanMarshall Clow2016-01-121-1/+2
| | | | llvm-svn: 257506
* Add a bunch of missing includes in the test suite to make it more portable. ↵Marshall Clow2016-01-1259-116/+175
| | | | | | Fixes bugs #26120 and #26121. Thanks to Jonathan Wakely for the reports and the patches. llvm-svn: 257474
* Put the definition of _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK in the ↵Marshall Clow2016-01-121-5/+5
| | | | | | right place. llvm-svn: 257422
* Preemptively disable unsigned integer sanitization in 32 and 64 bit versions ↵Marshall Clow2016-01-112-2/+11
| | | | | | of __murmur2_or_cityhash. This lets people use the unsigned integer overflow checker in UBSAN w/o getting hits from libc++'s hash code (where the unsigned integer overflow is legal and deliberate)> Patch by @danielaustin. Reviewed as: http://reviews.llvm.org/D15973 llvm-svn: 257368
* Revert "Remove visibility attributes from out-of-class method definitions in ↵Evgeniy Stepanov2016-01-084-86/+86
| | | | | | iostreams." llvm-svn: 257193
* [libcxx] Set LC_ALL rather than LC_COLLATE to override collation.Ahmed Bougacha2016-01-071-1/+1
| | | | | | | r251131 replaced LANG with LC_COLLATE. But LC_ALL has precedence over both, so the test still fails when LC_ALL=C. llvm-svn: 257018
* Add explicit include directives; the file was getting implicitly included ↵Marshall Clow2016-01-054-0/+4
| | | | | | already. NFC llvm-svn: 256864
* Remove some test scaffolding that I added and then didn't need. No ↵Marshall Clow2016-01-051-29/+0
| | | | | | functional change llvm-svn: 256861
* First half of LWG#2354: 'Unnecessary copying when inserting into maps with ↵Marshall Clow2016-01-057-4/+235
| | | | | | braced-init syntax' llvm-svn: 256859
OpenPOWER on IntegriCloud