summaryrefslogtreecommitdiffstats
path: root/libcxx/include/ext
Commit message (Collapse)AuthorAgeFilesLines
* [libc++] Cleanup and enable multiple warnings.Eric Fiselier2019-12-121-2/+3
| | | | | | | | | | Too many warnings are being disabled too quickly. Warnings are important to keeping libc++ correct. This patch re-enables two warnings: -Wconstant-evaluated and -Wdeprecated-copy. In future, all warnings disabled for the test suite should require an attached bug. The bug should state the plan for re-enabling that warning, or a strong case why it should remain disabled.
* [NFC] Strip trailing whitespace from libc++Louis Dionne2019-10-231-2/+2
|
* Change default bucket count in hash_set/hash_map.Eric Fiselier2019-08-012-13/+12
| | | | | | | | | | | Previously these types rehashed to a table of 193 elements upon construction. But this is non-ideal, first because default constructors should not allocate unless necessary, and second because 193 is big and can waste a bunch of memory. This number had previously been chosen to match GCC's implementation. llvm-svn: 367605
* Fix missing std:: qualifier in __gnu_cxx::hash_map in C++03Eric Fiselier2019-05-171-1/+1
| | | | llvm-svn: 361075
* Remove `using namespace std;` in __gnu_cxx namespace.Eric Fiselier2019-05-173-63/+60
| | | | | | | | The `using namespace std;` opens us up to ambiguity when any of the std:: names are also present in the global namespace. Instead we should properly qualify names we use from std::. llvm-svn: 361074
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-193-12/+9
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* Remove usages of _LIBCPP_MSVC which is never definedEric Fiselier2017-05-102-2/+2
| | | | llvm-svn: 302736
* Cleanup remaining _LIBCPP_HAS_NO_<c++11-feature> usages in container headersEric Fiselier2017-04-191-3/+3
| | | | llvm-svn: 300643
* Refer to _LIBCPP_MSVC macro where applicableSaleem Abdulrasool2017-02-062-2/+2
| | | | | | | | | Replace preprocess conditions of defined(_MSC_VER) && !defined(__clang__) with defined(_LIBCPP_MSVC). NFC. Patch by Dave Lee! llvm-svn: 294171
* [NFC] Rename _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VISEric Fiselier2017-01-043-27/+27
| | | | | | | | | | | | | The name _LIBCPP_TYPE_VIS_ONLY is no longer accurate because both _LIBCPP_TYPE_VIS and _LIBCPP_TYPE_VIS_ONLY expand to __attribute__((__type_visibility__)) with Clang. The only remaining difference is that _LIBCPP_TYPE_VIS_ONLY can be applied to templates whereas _LIBCPP_TYPE_VIS cannot (due to dllimport/dllexport not being allowed on templates). This patch renames _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS. llvm-svn: 291035
* Cleanup: move visibility/linkage attributes to the first declaration.Evgeniy Stepanov2016-04-222-4/+8
| | | | | | http://reviews.llvm.org/D15404 llvm-svn: 267093
* Recommit r260012 - Cleanup node-type handling in the unordered containers.Eric Fiselier2016-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This time I kept <ext/hash_map> working! 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 bugs and problems. llvm-svn: 260431
* Use __rebind_pointer to avoid #ifdef blockEric Fiselier2015-12-301-16/+4
| | | | llvm-svn: 256654
* Fix warnings about pessimizing return moves for C++11 and higherDimitry Andric2015-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Throughout the libc++ headers, there are a few instances where _VSTD::move() is used to return a local variable. Howard commented in r189039 that these were there "for non-obvious reasons such as to help things limp along in C++03 language mode". However, when compiling these headers with warnings on, and in C++11 or higher mode (like we do in FreeBSD), they cause the following complaints about pessimizing moves: In file included from tests.cpp:26: In file included from tests.hpp:29: /usr/include/c++/v1/map:1368:12: error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move] return _VSTD::move(__h); // explicitly moved for C++03 ^ /usr/include/c++/v1/__config:368:15: note: expanded from macro '_VSTD' #define _VSTD std::_LIBCPP_NAMESPACE ^ Attempt to fix this by adding a _LIBCPP_EXPLICIT_MOVE() macro to __config, which gets defined to _VSTD::move for pre-C++11, and to nothing for C++11 and later. I am not completely satisfied with the macro name (I also considered _LIBCPP_COMPAT_MOVE and some other variants), so suggestions are welcome. :) Reviewers: mclow.lists, howard.hinnant, EricWF Subscribers: arthur.j.odwyer, cfe-commits Differential Revision: http://reviews.llvm.org/D11394 llvm-svn: 245421
* [libcxx] Fix detection of __is_final.Eric Fiselier2015-06-131-8/+7
| | | | | | | | | | | | | | Summary: Currently we only enable the use of __is_final(...) with Clang. GCC also provides __is_final(...) since 4.7 in all standard modes. This patch creates the macro _LIBCPP_HAS_IS_FINAL to note the availability of `__is_final`. Reviewers: danalbert, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8795 llvm-svn: 239664
* In many places, there was an #ifdef/#else block that selected one of two ↵Marshall Clow2015-04-071-14/+2
| | | | | | implmentations of rebind_alloc based on whether or not we had template aliases. Create a helper struct to encapsulate that bit of logic, and replace all the ifdefs with uses of that struct. No functionality change intented. llvm-svn: 234296
* Do not derive __gnu_cxx::hash<T> from std::hash<T>.Peter Collingbourne2014-03-061-2/+91
| | | | | | | | | | | | | | | | | | Instead, define explicit specializations for the basic types listed in the SGI documentation. This solves two problems: 1) Helps avoid silent ODR violations caused by the absence of a user-supplied __gnu_cxx::hash specialization in cases where a std::hash specialization exists (e.g. for std::string). 2) __gnu_cxx::hash semantics are slightly different to those of std::hash (for example, the former may dereference a pointer argument) so it is inappropriate for __gnu_cxx::hash to receive std::hash specializations by default. Differential Revision: http://llvm-reviews.chandlerc.com/D2747 llvm-svn: 203070
* [libc++] Const qualify __gnu_cxx::hash_map<>::const_iterator::pointer type.Peter Collingbourne2014-03-031-2/+2
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2811 llvm-svn: 202749
* Don't use T as template argument, it is part of the applicationJoerg Sonnenberger2013-11-251-1/+1
| | | | | | namespace. llvm-svn: 195693
* G M: Provides the _LIBCPP_WARNING macro, to be used for MSVC only, since ↵Howard Hinnant2013-10-042-2/+10
| | | | | | that compiler doesn't support #warning. llvm-svn: 191980
* Zhihao Yuan noted that there were a few unneeded statements. Eliminated ↵Howard Hinnant2013-08-221-1/+1
| | | | | | the unnecessary ones, and commented the ones that are there for non-obvious reasons such as to help things limp along in C++03 language mode. llvm-svn: 189039
* Nico Rieck: this patch series fixes visibility issues on Windows as ↵Howard Hinnant2013-08-123-18/+18
| | | | | | explained in <http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-August/031214.html>. llvm-svn: 188192
* No functionality change at this time. I've split _LIBCPP_VISIBLE up into ↵Howard Hinnant2013-03-063-18/+18
| | | | | | two flags: _LIBCPP_TYPE_VIS and _LIBCPP_FUNC_VIS. This is in preparation for taking advantage of clang's new __type_visibility__ attribute. llvm-svn: 176593
* Dimitry Andric: Silence some miscellaneous warnings.Howard Hinnant2012-11-061-1/+1
| | | | llvm-svn: 167493
* Fix http://llvm.org/bugs/show_bug.cgi?id=11461. Credit Alberto Ganesh Barbati.Howard Hinnant2011-12-111-2/+10
| | | | llvm-svn: 146345
* Further macro protection by replacing _[A-Z] with _[A-Z]pHoward Hinnant2011-11-291-5/+5
| | | | llvm-svn: 145410
* Revert r136547, r136545, and r136542 by removing slist.Chandler Carruth2011-07-301-126/+0
| | | | | | | | | | | This was checked in without review. It is not clear its reasonable to include with libc++ at all, and needs discussion at a highlevel before moving forward. It's also completely lacking tests, and included several bugs in the implementation. llvm-svn: 136577
* Add the missing default argument for the allocator and use a cleanerAlexis Hunt2011-07-301-13/+7
| | | | | | implementation of previous(). llvm-svn: 136547
* Oops. That last commit was from an earlier revision of the file and wasAlexis Hunt2011-07-301-11/+15
| | | | | | | more than just a bit broken. This one should compile and run without infinite loops. llvm-svn: 136545
* Include an "implementation" if SGI's slist. This was quickly hackedAlexis Hunt2011-07-291-0/+128
| | | | | | | | | | | together to get it working with code, and is neither optimal (erase(Iterator, Iterator) calculates the previous iterator twice, rather than calculating the previous iterator of the first one, then advancing it until the second is found) nor complete (splice() was not implemented). Most of the implementation is borrowed from forward_list via using-declarations. llvm-svn: 136542
* Add a new hash class in __gnu_ext for the extension containers. ThereAlexis Hunt2011-07-293-1/+49
| | | | | | | | | | | | | | are two motivations for this. First, this allows users who are specializing __gnu_ext::hash to continue doing so without changing their code. Second, SGI specifies hash overloads for char* and const char* that perform a hash of the string, not of the pointer. In order to support this, the hashing code for string is factored out. llvm-svn: 136539
* Add two missing members from the extension hash containers. The first isAlexis Hunt2011-07-292-0/+10
| | | | | | | | | | | | | | | | the type name 'data_type', which is specified by the SGI spec as being the correct type name for the mapped type. The second is an overload of insert found in standard containers, taking an iterator as a 'hint' (which we ignore in the standard containers as well). libstdc++'s implementation includes these overloads, and they are needed to make insert_iterator work (which I suspect is the real motivation for including them in the standard containers). The motivation for including these overloads of insert and leaving the mapped_type typedef is to make it easier for clients to migrate to the standard containers. llvm-svn: 136538
* http://llvm.org/bugs/show_bug.cgi?id=10469Howard Hinnant2011-07-242-0/+4
| | | | llvm-svn: 135897
* _STD -> _VSTD to avoid macro clash on windowsHoward Hinnant2011-06-302-11/+11
| | | | llvm-svn: 134190
* Qualify calls to addressof with std::. Bug 9106Howard Hinnant2011-02-021-4/+4
| | | | llvm-svn: 124726
* license changeHoward Hinnant2010-11-162-4/+4
| | | | llvm-svn: 119395
* visibility-decoration.Howard Hinnant2010-09-212-50/+180
| | | | llvm-svn: 114486
* Changed __config to react to all of clang's currently documented has_feature ↵Howard Hinnant2010-09-041-3/+3
| | | | | | flags, and renamed _LIBCPP_MOVE to _LIBCPP_HAS_NO_RVALUE_REFERENCES to be more consistent with the rest of the libc++'s flags, and with clang's nomenclature. llvm-svn: 113086
* Fixing whitespace problemsHoward Hinnant2010-08-221-3/+3
| | | | llvm-svn: 111750
* Wiped out some non-ascii characters that snuck into the copyright.Howard Hinnant2010-05-112-2/+2
| | | | llvm-svn: 103516
* libcxx initial importHoward Hinnant2010-05-112-0/+1506
llvm-svn: 103490
OpenPOWER on IntegriCloud