Commit Graph

421 Commits

Author SHA1 Message Date
David Chisnall
f2533a8798 Make sure [at_]quick_exit is in std::
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@152717 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-14 14:10:37 +00:00
Jeffrey Yasskin
558ae17391 Fix moneypunct_byname algorithm to more accurately represent C locales in C++.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@152501 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-10 18:31:43 +00:00
Howard Hinnant
05b57d5cdf Change some smart_ptr == 0 to smart_ptr == nullptr. Fixes http://llvm.org/bugs/show_bug.cgi?id=12185.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@152240 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-07 20:37:43 +00:00
David Chisnall
b56a4ada33 Define _WCHAR_T in solaris/wchar.h. This fixes a bug where Solaris 10 headers
try to define C++ keywords as typedefs (fixed in Solaris 11).



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@151890 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 10:56:04 +00:00
David Chisnall
b6e7c305d4 Fix MSVC / Sun #ifdef ordering. Remove another #if-nothing-#endif.
Sorry for the churn.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@151731 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-29 16:41:21 +00:00
David Chisnall
26cba271cb Remove a spurious #ifdef / #endif pair with nothing between them.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@151729 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-29 16:22:33 +00:00
David Chisnall
ea2741973a Add support files required for building on Solaris.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@151721 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-29 13:17:28 +00:00
David Chisnall
997e454139 Solaris port. Currently sees around 200 test failures, mostly related to
Solaris not providing some of the locales that the test suite uses.

Note: This depends on an xlocale (partial) implementation for Solaris and a
couple of fixed standard headers.  These will be committed to a branch later
today.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@151720 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-29 13:05:08 +00:00
David Chisnall
8fa14e97ca Don't define __locale_raii if we are not going to be using it.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@151718 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-29 13:00:07 +00:00
Howard Hinnant
4a13b2dce9 Reduce the number of move constructions when constructing a std::function. This fixes http://llvm.org/bugs/show_bug.cgi?id=12105.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@151652 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-28 19:47:38 +00:00
Howard Hinnant
0438ea241e vector::emplace_back was mistakenly requiring move assignable. Fixed that and did a little drive-by optimization at the same time. This fixes http://llvm.org/bugs/show_bug.cgi?id=12085.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@151492 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-26 15:30:12 +00:00
Howard Hinnant
4300839b5f Hook up to the new clang __is_trivially_constructible and __is_trivially_assignable traits. Fixes r10925427 and http://llvm.org/bugs/show_bug.cgi?id=12038.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@151406 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 23:32:26 +00:00
Howard Hinnant
7786188d15 Modernize conversion to bool to the explicit bool conversion operator (library wide). This fixes http://llvm.org/bugs/show_bug.cgi?id=12058.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@151088 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 21:46:43 +00:00
Howard Hinnant
3fadda314a Modernize relational operators for shared_ptr and unique_ptr. This includes adding support for nullptr, and using less<T*>. Fixes http://llvm.org/bugs/show_bug.cgi?id=12056.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@151084 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 21:02:58 +00:00
Bob Wilson
d41b60b2b4 Add missing newlines at EOF.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@150965 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 16:56:13 +00:00
Howard Hinnant
3508b3836b Give the emulated nullptr_t a default constructor.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@150893 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-18 22:01:22 +00:00
Howard Hinnant
1e9f55f2d2 Use __is_polymorphic if available. This fixes http://llvm.org/bugs/show_bug.cgi?id=11983 . Patch contributed by Jonathan Sauer.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@150614 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 20:47:11 +00:00
Howard Hinnant
2848444954 tuple was accidentally lacking a valid copy assignment operator. It went undetected because I had failed to test assigning from a const lvalue. This fixes http://llvm.org/bugs/show_bug.cgi?id=11921
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@150613 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 20:13:52 +00:00
Howard Hinnant
b04ad4162d Do not parse sign if a sign is not the next legal character when parsing floating point from an input stream. Fixes http://llvm.org/bugs/show_bug.cgi?id=11871
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@150609 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 19:19:37 +00:00
Howard Hinnant
d7a2ad6a99 Another stab at fixing http://llvm.org/bugs/show_bug.cgi?id=12007. I earlier missed that there are two common_type definitions and corrected only one of them.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@150599 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 18:08:09 +00:00
Howard Hinnant
e5285fd6b6 Remove reference from common_type definition. It looks like a recent clang decltype implementation got fixed/improved and exposed this. Fixes http://llvm.org/bugs/show_bug.cgi?id=12007.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@150581 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 15:08:30 +00:00
Howard Hinnant
b0bfd9bdd6 Implement a few optimizations for vector push_back and insert. Fixes r10828365.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@150542 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 00:41:34 +00:00
Howard Hinnant
5f3f35fe64 Provide a move(const T&) overload for C++03 mode to enable moving from rvalues. This is to support proxy references. Fixes r10858112.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@150488 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 16:03:09 +00:00
Howard Hinnant
a18778751c Enable full functionality of shared_ptr<const void> by adding allocator<const void>. Credit to John Hurley for discovering this bug.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@148508 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19 23:15:22 +00:00
Howard Hinnant
e1a7b04c58 Fix http://llvm.org/bugs/show_bug.cgi?id=11752
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@148069 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12 23:37:51 +00:00
Howard Hinnant
ae8b16e047 Fix http://llvm.org/bugs/show_bug.cgi?id=11734
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@147853 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-10 15:15:47 +00:00
Howard Hinnant
571994088f 1. Fix make_shared<const T>. 2. Allow allocator<const T> as an extension. 3. Refactor work which fixed unique_ptr<const T[]>. 4. Remove no-longer-needed private declarations from unique_ptr. 5. Add constraints to some shared_ptr and weak_ptr constructors and assignment operators so that is_constructible/is_assignable give the correct answers for shared_ptr and weak_ptr. 6. Make defensive preparations in the shared_ptr free functions for the introduction of shared_ptr<T[]> in the future. 7. As an optimization, add move constructor and move assignment to weak_ptr.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@147437 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-02 17:56:02 +00:00
Howard Hinnant
8292d74270 The exception recovery mechanism for the uninitialized_* algorithms did not work for iterators into discontiguous memory.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@147343 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-29 17:45:35 +00:00
Howard Hinnant
6cc99fa338 Fix http://llvm.org/bugs/show_bug.cgi?id=11616
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@146881 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 17:58:44 +00:00
David Chisnall
83b2c84a3c Some fixes to <atomic> operations to explicitly use atomic types and operations.
The integral types now work with clang trunk (if you remove the guard), although we're still missing an intrinsic for initialising atomics (needed for C1x too).

Howard: Please review.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@146865 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 11:44:20 +00:00
Howard Hinnant
8e84350ebf Allow unique_ptr<T const []> to be constructed and assigned from a unique_ptr<T[]>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@146853 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-18 21:19:44 +00:00
Howard Hinnant
0a63119a76 Allow unique_ptr<T const []> to be constructed with a T* (in addition to a const T*)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@146736 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 15:37:23 +00:00
Howard Hinnant
f8880d0b85 As an extension, support incomplete types in the unordered containers to match what we already do in the associative containers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@146376 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 17:26:24 +00:00
Howard Hinnant
d4cf215e08 Fix http://llvm.org/bugs/show_bug.cgi?id=11461. Credit Alberto Ganesh Barbati.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@146345 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-11 20:31:33 +00:00
Howard Hinnant
c00f75dc75 Installation of CityHash by Craig Silverstein
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@146329 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-10 20:28:56 +00:00
Howard Hinnant
40c13d31c5 Starting using murmur2 when combining multiple size_t's into a single hash, and also for basic_string. Also made hash<thread::id> ever so slighly more portable. I had to tweak one test which is questionable (definitely not portable) anyway.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145795 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05 00:08:45 +00:00
Howard Hinnant
cf2654bae7 Version #next on the hash functions for scalars. This builds on Dave's work, extends it to T*, and changes the way double and long double are handled (no longer convert to float on 32 bit). I also picked up a minor bug with uninitialized bits on the upper end of size_t when sizeof(size_t) > sizeof(T), e.g. in hash<float>. Most of the functionality has been put in one place: __scalar_hash in <memory>. Unfortunately I could not reuse __scalar_hash for hash<long double> on x86 because of the padding bits which need to be zeroed. I didn't want to add this zeroing step to the more general __scalar_hash when it isn't needed (in the absence of padding bits). I'm not ignoring the hash<string> issue (possibly changing that to a better hash). I just haven't gotten there yet.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145778 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-03 21:11:36 +00:00
Howard Hinnant
2891675aad I had picked up the wrong version of DaveZ's hash patches. Corrected here.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145728 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02 23:45:22 +00:00
Howard Hinnant
62453ea71d Fixes to hash for long long, unsigned long long, float, double and long double. Credit Dave Zarzycki
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145721 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02 22:52:09 +00:00
Howard Hinnant
e814a90f74 Fix http://llvm.org/bugs/show_bug.cgi?id=11459. Patch supplied by Alberto Ganesh Barbati.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145703 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02 20:41:47 +00:00
Howard Hinnant
f6d875f7f5 Fix http://llvm.org/bugs/show_bug.cgi?id=11428. Fix provided by Alberto Ganesh Barbati
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145698 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02 19:36:40 +00:00
Howard Hinnant
438377c051 Jean-Daniel: __builtin_popcountll support for Windows
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145684 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02 17:22:38 +00:00
Howard Hinnant
ec3773c2da Quash a whole bunch of warnings
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145624 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01 20:21:04 +00:00
Howard Hinnant
9996844df0 Further macro protection by replacing _[A-Z] with _[A-Z]p
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145410 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 18:15:50 +00:00
Howard Hinnant
66c6f9733b Add protection from min/max macros
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145407 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 16:45:27 +00:00
Howard Hinnant
34869adacb Remove redundant iterator assignment detected by Marshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145265 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-28 19:49:26 +00:00
David Chisnall
91a8272cbd On FreeBSD, define a macro that causes the unimplemented C99 math.h functions to be declared. This prevents <cmath> users from being broken, unless they actually use the C++ wrappers that call the missing functions.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@144501 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-13 17:15:33 +00:00
Howard Hinnant
ce6884cc76 Fix ratio arithmetic with zero
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@143519 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-01 23:13:37 +00:00
Howard Hinnant
9f8884e6c1 Windows port work by Ruben Van Boxem
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@143105 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-27 16:24:42 +00:00
Howard Hinnant
8faa95ff8c Fixed bug in __independent_bits_engine found by Nick (from stackoverflow)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@143104 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-27 16:12:10 +00:00