summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
* Reorganize _LIBCPP_LOCALE__L_EXTENSIONSBen Craig2016-03-094-438/+230
| | | | | | | | | | | | | | | | Instead of checking _LIBCPP_LOCALE_L_EXTENSIONS all over, instead check it once, and define the various *_l symbols once. The private redirector symbol names are all prefixed with _libcpp_* so that they won't conflict with user symbols, and so they won't conflict with future C library symbols. In particular, glibc likes providing private symbols such as __locale_t, so we should follow a different naming pattern (like _libcpp_*) to avoid problems on that front. Tested on Linux with glibc. Hoping for the best on OSX and the various BSDs. http://reviews.llvm.org/D17456 llvm-svn: 263016
* Remove a couple tabs that crept inMarshall Clow2016-03-081-2/+2
| | | | llvm-svn: 262932
* Implement P0272R1: Give 'std::string' a non-const '.data()' member functionMarshall Clow2016-03-083-11/+42
| | | | llvm-svn: 262931
* Implement P0253R1: Fixing a design mistake in the searchers interface.Marshall Clow2016-03-0816-54/+64
| | | | llvm-svn: 262928
* Implement P0025R0: 'An algorithm to clamp a value between a pair of boundary ↵Marshall Clow2016-03-074-2/+150
| | | | | | values' for C++17 llvm-svn: 262871
* non-member swap for array was mistakenly taking const ref params. Fixed and ↵Marshall Clow2016-03-072-2/+29
| | | | | | added test. Thanks to Ben Craig for the catch llvm-svn: 262866
* Update with work items passed in JacksonvilleMarshall Clow2016-03-061-1/+47
| | | | llvm-svn: 262807
* libc++: fix typoJF Bastien2016-03-051-1/+1
| | | | llvm-svn: 262771
* Fix for PR26812: possible overflow issue in std::allocator::allocateMarshall Clow2016-03-032-2/+64
| | | | llvm-svn: 262610
* more status updatesMarshall Clow2016-02-251-7/+7
| | | | llvm-svn: 261926
* Added tests to make sure that the categorization traits work on incomplete typesMarshall Clow2016-02-2529-15/+127
| | | | llvm-svn: 261925
* Update the status of a N4089 and a couple issuesMarshall Clow2016-02-251-3/+3
| | | | llvm-svn: 261896
* Another chunk of N4089Marshall Clow2016-02-251-19/+2
| | | | llvm-svn: 261894
* No, really - test the constructorMarshall Clow2016-02-251-1/+1
| | | | llvm-svn: 261875
* Add test to ensure that the converting constructor in N4089 is present and ↵Marshall Clow2016-02-251-0/+27
| | | | | | working llvm-svn: 261874
* Fix a missing closing tagMarshall Clow2016-02-231-1/+1
| | | | llvm-svn: 261677
* More updatesMarshall Clow2016-02-231-8/+8
| | | | llvm-svn: 261676
* These new tests fail on the green-dragon bots, which use an old Apple compiler.Marshall Clow2016-02-231-8/+10
| | | | | | | Since they're scheduled to be updated soon, we'll just comment out this test for the moment, and re-commit when the bots are updated. llvm-svn: 261661
* More updatesMarshall Clow2016-02-231-11/+11
| | | | llvm-svn: 261655
* Add tests for LWG#2560. No code changes, just testsMarshall Clow2016-02-231-0/+9
| | | | llvm-svn: 261653
* Add additional tests to ensure that we DTRT with short lists. This is ↵Marshall Clow2016-02-231-0/+14
| | | | | | LWG#2590, but there are no code changes, just additional tests llvm-svn: 261648
* More updates; patch for 2583 readyMarshall Clow2016-02-231-4/+4
| | | | llvm-svn: 261647
* Fix __is_referenceable to work with vector types. Fixes PR#26654 and 26656. ↵Marshall Clow2016-02-222-26/+12
| | | | | | Thanks to Evgeniy for the reports, and to Eric for the suggestion on how to fix it. llvm-svn: 261581
* Rename <__hash_table> traits so they don't conflict with similar traits.Eric Fiselier2016-02-202-11/+11
| | | | | | In particular <__tree> defines many of the same types of traits classes. llvm-svn: 261421
* Remove all usages of "const" node pointer typedefs in the assoc containers.Eric Fiselier2016-02-203-111/+69
| | | | | | | | | | | | | | | | | The "const" pointer typedefs such as "__node_const_pointer" and "__node_base_const_pointer" are identical to their non-const pointer types. This patch changes all usages of "const" pointer type names to their respective non-const typedef. Since "fancy pointers to const" cannot be converted back to a non-const pointer type according to the allocator requirements it is important that we never actually use "const" pointers. Furthermore since "__node_const_pointer" and "__node_pointer" already name the same type, it's very confusing to use both names. Especially when defining const/non-const overloads for member functions. llvm-svn: 261419
* Cleanup node-type handling in the associative containers.Eric Fiselier2016-02-208-77/+488
| | | | | | | | | | | | | | | | | | | | | | | This patch is very similar to r260431. This patch is the first in a series of patches that's meant to better support map. 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 __tree about this special value_type. This patch creates a "__tree_node_types" traits class that contains all of the typedefs needed by the associative containers and their iterators. These typedefs include ones for each node type and node pointer type, as well as special typedefs for "map"'s value type. Although the associative containers already supported incomplete types, this patch makes it official by adding tests. This patch will be followed up shortly with various cleanups within __tree and fixes for various map bugs and problems. llvm-svn: 261416
* Work around GCC bug in .fail.cpp testsEric Fiselier2016-02-201-1/+7
| | | | llvm-svn: 261391
* Fix PR26622 - Make CheckLibcxxAtomic.cmake use the libc++ headers.Eric Fiselier2016-02-201-2/+2
| | | | llvm-svn: 261383
* Make __wrap_iter work with GCC againEric Fiselier2016-02-203-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This bug was originally fixed in http://reviews.llvm.org/D7201. However it was broken again by the fix to https://llvm.org/bugs/show_bug.cgi?id=22605. This patch re-fixes __wrap_iter with GCC by providing a forward declaration of <vector> before the friend declaration in __wrap_iter. This patch avoids the issues in PR22605 by putting canonical forward declarations in <iosfwd> and including <iosfwd> in <vector>. <iosfwd> was chosen as the canonical forward declaration headers for the following reasons: 1. `<iosfwd>` is small with almost no dependancies. 2. It already forward declares `std::allocator` 3. It is already included in `<iterator>` which we need to fix the GCC bug. This patch fixes the test "gcc_workaround.pass.cpp" Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16345 llvm-svn: 261382
* Add stdbool.h wrapper for libc++Eric Fiselier2016-02-201-0/+39
| | | | | | | | | | | | | | | | | | Summary: According to the C++ standard <stdbool.h> isn't allowed to define `true` `false` or `bool`. However these macros are sometimes defined by the compilers `stdbool.h`. Clang defines the macros whenever `__STRICT_ANSI__` isn't defined (ie `-std=gnu++11`). New GCC versions define the macros in C++03 mode only, older GCC versions (4.9 and before) always define the macros. This patch adds a wrapper header for `stdbool.h` that undefs the required macros. Reviewers: mclow.lists, rsmith, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16346 llvm-svn: 261381
* Split locale management out of newlib/xlocale.h. NFCIBen Craig2016-02-182-30/+53
| | | | | | | | | | | | | | | | | | | | | | | This is one part of many of a locale refactor. See http://reviews.llvm.org/D17146 for an idea of where this is going. For the locale refactor, the locale management functions (newlocale, freelocale, uselocale) are needed in a separate header from the various _l functions. This is because some platforms implement the _l functions in terms of a locale switcher RAII helper, and the locale switcher RAII helper needs the locale management functions. This patch helps pave the way by getting all the functions in the right files, so that later diffs aren't completely horrible. The "do-nothing" / "nop" locale functions are also useful on their own for other lightweight platforms. Putting these nop implementations in support/xlocale should enable code sharing. Unfortunately, I have no access to a newlib system to build and test with, so this change has been made blind. Reviewed: http://reviews.llvm.org/D17382 llvm-svn: 261231
* Split locale management out of ibm/xlocale.h. NFCIBen Craig2016-02-182-56/+86
| | | | | | | | | | | | | | | | | | | | This is one part of many of a locale refactor. See http://reviews.llvm.org/D17146 for an idea of where this is going. For the locale refactor, the locale management functions (newlocale, freelocale, uselocale) are needed in a separate header from the various _l functions. This is because some platforms implement the _l functions in terms of a locale switcher RAII helper, and the locale switcher RAII helper needs the locale management functions. This patch helps pave the way by getting all the functions in the right files, so that later diffs aren't completely horrible. Unfortunately, I have no access to an AIX machine to build with, so this change has been made blind. Also, the original author (Xing Xue) does not appear to have a Phabricator account. Reviewed: http://reviews.llvm.org/D17380 llvm-svn: 261230
* Commit tests missing from r261180.Eric Fiselier2016-02-182-0/+42
| | | | llvm-svn: 261181
* Get <ext/hash_map> working againEric Fiselier2016-02-181-3/+5
| | | | llvm-svn: 261180
* [libcxx] Fix definition of regex_traits::__regex_word on big-endian glibc ↵Daniel Sanders2016-02-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | systems Summary: On glibc, the bits used for the various character classes is endian dependant (see _ISbit() in ctypes.h) but __regex_word does not account for this and uses a spare bit that isn't spare on big-endian. On big-endian, it overlaps with the bit for graphic characters which causes '-', '@', etc. to be considered a word character. Fixed this by defining the value using _ISbit(15) on MIPS glibc systems. We've restricted this to MIPS for now to avoid the risk of introducing failures in other targets. Fixes PR26476. Reviewers: hans, mclow.lists Subscribers: dsanders, cfe-commits Differential Revision: http://reviews.llvm.org/D17132 llvm-svn: 261088
* Add some statusMarshall Clow2016-02-161-4/+4
| | | | llvm-svn: 260975
* Add some commentsMarshall Clow2016-02-161-9/+9
| | | | llvm-svn: 260966
* Added a (private) status page for the Jacksonville meetingMarshall Clow2016-02-162-154/+129
| | | | llvm-svn: 260964
* Issue a warning instead of fatal errors when checks for libatomic fail.Vasileios Kalintiris2016-02-161-2/+2
| | | | | | | | | | | | This should fix PR26631, PR26622 and has the nice property that the addition of the CheckLibcxxAtomic.cmake module acts as an NFC on the platforms of the reporters (at least for the time being). As these bug reports explain, CMake fails the atomic check because the include headers might not exist in the host environment. We could potentially point to the headers provided by libcxx itself. llvm-svn: 260961
* Instead of asking glibc to provide correct C++ signatures for <string.h>Richard Smith2016-02-111-9/+5
| | | | | | | | functions, ask it whether it did provide them after the fact. Some versions of glibc fail to compile if you make this request and don't also claim to be at least GCC 4.3. llvm-svn: 260622
* Fix LWG issue 2469 - Use piecewise construction in unordered_map::operator[].Eric Fiselier2016-02-114-42/+78
| | | | | | | | | | | | | unordered_map's allocator may only be used to construct objects of 'value_type', or in this case 'pair<const Key, Value>'. In order to respect this requirement in operator[], which requires default constructing the 'mapped_type', we have to use pair's piecewise constructor with '(tuple<Kep>, tuple<>)'. Unfortunately we still need to provide a fallback implementation for C++03 since we don't have <tuple>. Even worse this fallback is the last remaining user of '__hash_map_node_destructor' and '__construct_node_with_key'. llvm-svn: 260601
* Work around regression in glibc 2.22: request that glibc provides the correctRichard Smith2016-02-111-0/+4
| | | | | | | prototypes for <string.h> functions that are converted into overload sets in C++. This matches the existing workaround in <wchar.h>. llvm-svn: 260570
* Revert r260514 because it has a bogus commit message.Eric Fiselier2016-02-114-78/+42
| | | | llvm-svn: 260556
* Rename CheckLibcxxAtomic.cmake variable result names so they don't clash ↵Eric Fiselier2016-02-111-2/+2
| | | | | | with LLVM llvm-svn: 260531
* Add some tests to ensure that the __regex_word does not conflict with any of ↵Marshall Clow2016-02-111-0/+13
| | | | | | | | ctype_base's values. Hopefully this will catch cases like https://llvm.org/bugs/show_bug.cgi?id=26476 in the future. llvm-svn: 260527
* Properly down-cast a sentinal node pointer through void*Eric Fiselier2016-02-111-1/+2
| | | | llvm-svn: 260526
* Fix r260515 - Correct typos in CMake changesEric Fiselier2016-02-112-8/+4
| | | | llvm-svn: 260524
* separate nested >>Eric Fiselier2016-02-111-1/+1
| | | | llvm-svn: 260516
* Re-commit "Introduce a cmake module to figure out whether we need to link ↵Vasileios Kalintiris2016-02-116-0/+52
| | | | | | | | | | with libatomic." This re-applies commit r260235. However, this time we add -gcc-toolchain to the compiler's flags when the user has specified the LIBCXX_GCC_TOOLCHAIN variable. llvm-svn: 260515
* Teach __hash_table how to handle unordered_map's __hash_value_type.Eric Fiselier2016-02-114-42/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is fairly large and contains a number of changes. The main change is teaching '__hash_table' how to handle '__hash_value_type'. Unfortunately this change is a rampant layering violation, but it's required to make unordered_map conforming without re-writing all of __hash_table. After this change 'unordered_map' can delegate to '__hash_table' in almost all cases. The major changes found in this patch are: * Teach __hash_table to differentiate between the true container value type and the node value type by introducing the "__container_value_type" and "__node_value_type" typedefs. In the case of unordered_map '__container_value_type' is 'pair<const Key, Value>' and '__node_value_type' is '__hash_value_type'. * Switch almost all overloads in '__hash_table' previously taking 'value_type' (AKA '__node_value_type) to take '__container_value_type' instead. Previously 'pair<K, V>' would be implicitly converted to '__hash_value_type<K, V>' because of the function signature. * Add '__get_key', '__get_value', '__get_ptr', and '__move' static functions to '__key_value_types'. These functions allow '__hash_table' to unwrap '__node_value_type' objects into '__container_value_type' and its sub-parts. * Pass '__hash_value_type::__value_' to 'a.construct(p, ...)' instead of '__hash_value_type' itself. The C++14 standard requires that 'a.construct()' and 'a.destroy()' are only ever instantiated for the containers value type. * Remove '__hash_value_type's constructors and destructors. We should never construct an instance of this type. (TODO this is UB but we already do it in plenty of places). * Add a generic "try-emplace" function to '__hash_table' called '__emplace_unique_key_args(Key const&, Args...)'. The following changes were done as cleanup: * Introduce the '_LIBCPP_CXX03_LANG' macro to be used in place of '_LIBCPP_HAS_NO_VARIADICS' or '_LIBCPP_HAS_NO_RVALUE_REFERENCE'. * Cleanup C++11 only overloads that assume an incomplete C++11 implementation. For example this patch removes the __construct_node overloads that do manual pack expansion. * Forward 'unordered_map::emplace' to '__hash_table' and remove dead code resulting from the change. This includes almost all 'unordered_map::__construct_node' overloads. The following changes are planed for future revisions: * Fix LWG issue #2469 by delegating 'unordered_map::operator[]' to use '__emplace_unique_key_args'. * Rewrite 'unordered_map::try_emplace' in terms of '__emplace_unique_key_args'. * Optimize '__emplace_unique' to call '__emplace_unique_key_args' when possible. This prevent unneeded allocations when inserting duplicate entries. The additional follow up work needed after this patch: * Respect the lifetime rules for '__hash_value_type' by actually constructing it. * Make '__insert_multi' act similar to '__insert_unique' for objects of type 'T&' and 'T const &&' with 'T = __container_value_type'. llvm-svn: 260514
OpenPOWER on IntegriCloud