- Sep 04, 2016
-
-
Kuba Brecka authored
call_once is using relaxed atomic load to perform double-checked locking, which contains a data race. The fast-path load has to be an acquire atomic load. Differential Revision: https://reviews.llvm.org/D24028 llvm-svn: 280621
-
- Aug 25, 2016
-
-
Marshall Clow authored
Followon to r279744. Find the other exception types and make __throw_XXX routines (and call them). Remove the generic __libcpp_throw routine, since no one uses it anymore. llvm-svn: 279763
-
Marshall Clow authored
Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855. llvm-svn: 279744
-
- Jul 24, 2016
-
-
Eric Fiselier authored
llvm-svn: 276544
-
- Jul 11, 2016
-
-
Marshall Clow authored
Always use the allocator to construct/destruct elements of a deque/vector. Fixes PR#28412. Thanks to Jonathan Wakely for the report. llvm-svn: 275105
-
- Jun 27, 2016
-
-
Eric Fiselier authored
This patch adds the weak_type typedef in shared_ptr. It is available in C++17 and newer. This patch also updates the _LIBCPP_STD_VER and TEST_STD_VER macros to have the value of 16, since 2016 is the current year. llvm-svn: 273839
-
Eric Fiselier authored
See https://llvm.org/bugs/show_bug.cgi?id=27115 The problem was that the conversion from 'const enable_shared_from_this<T>*' to 'const T*' didn't work if T inherited enable_shared_from_this as a virtual base class. The fix is to take the original pointer passed to shared_ptr's constructor in the __enable_weak_this method and perform an upcast to 'const T*' instead of performing a downcast from the enable_shared_from_this base. llvm-svn: 273835
-
- Jun 18, 2016
-
-
Eric Fiselier authored
Summary: Currently the implementation of [util.smartptr.shared.atomic] is provided only when using Clang, and not with GCC. This is a relic of not having a GCC implementation of <atomic>, even though <atomic> isn't actually used in the implementation. This patch enables support for atomic shared_ptr functions when using GCC. Note that this is not a header only change. Previously only Clang builds of libc++.so would provide the required symbols. There is no reason for this restriction. After this change both Clang and GCC builds should be binary compatible with each other WRT these symbols. Reviewers: mclow.lists, rmaprath, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D21407 llvm-svn: 273076
-
- Jun 02, 2016
-
-
Eric Fiselier authored
llvm-svn: 271487
-
Eric Fiselier authored
Summary: See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0033r1.html Reviewers: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19254 llvm-svn: 271449
-
- May 18, 2016
-
-
Marshall Clow authored
When you assign a shared_ptr, the deleter gets called and assigned. In this routine, the assignment happens inside a critical section, which could (potentially) lead to a deadlock, if the deleter did something wonky. Now we swap the old value with an (empty) temporary shared_ptr, and then let the temporary delete the old value when it goes out of scope (after the lock has been released). This should fix PR#27724. Thanks to Hans Boehm for the bug report and the suggested fix. llvm-svn: 269965
-
- May 07, 2016
-
-
Eric Fiselier authored
llvm-svn: 268842
-
- Apr 22, 2016
-
-
Eric Fiselier authored
llvm-svn: 267079
-
Eric Fiselier authored
llvm-svn: 267074
-
- Mar 03, 2016
-
-
Marshall Clow authored
llvm-svn: 262610
-
- Feb 25, 2016
-
-
Marshall Clow authored
llvm-svn: 261894
-
- Jan 11, 2016
-
-
Marshall Clow authored
Preemptively disable unsigned integer sanitization in 32 and 64 bit versions 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
-
- Dec 09, 2015
-
-
Evgeniy Stepanov authored
These are the cases when an out-of-class definition of a method is marked _LIBCPP_INLINE_VISIBILITY, but the in-class declaration is not. This will start failing when (or if) we switch to attribute((internal_linkage)). llvm-svn: 255166
-
- Nov 12, 2015
-
-
Marshall Clow authored
llvm-svn: 252905
-
- Nov 07, 2015
-
-
Evgeniy Stepanov authored
This change moves visibility attributes from out-of-class method definitions to in-class declaration. This is needed for a switch to attribute((internal_linkage)) (see http://reviews.llvm.org/D13925) which can only appear on the first declaration. This change does not touch istream/ostream/streambuf. They are handled separately in http://reviews.llvm.org/D14409. llvm-svn: 252385
-
- Oct 25, 2015
-
-
Marshall Clow authored
llvm-svn: 251252
-
Marshall Clow authored
llvm-svn: 251247
-
- Aug 28, 2015
-
-
Eric Fiselier authored
Summary: This patch properly constrains the converting assignment operator in C++03. It also fixes a bug where std::forward was given the wrong type. The following two tests begin passing in C++03: * `unique_ptr.single.asgn/move_convert.pass.cpp` * `unique_ptr.single.asgn/move_convert13.fail.cpp` Reviewers: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12173 llvm-svn: 246272
-
- Aug 23, 2015
-
-
Eric Fiselier authored
Currently we need an #ifdef branch every time we use pointer traits to rebind a pointer because it is done differently in C++11 and C++03. This patch introduces the __rebind_pointer utility to clean this up. Also add a test that list and it's iterators can be instantiated with incomplete element types. llvm-svn: 245806
-
Eric Fiselier authored
llvm-svn: 245805
-
Eric Fiselier authored
Currently we need an #ifdef branch every time we use pointer traits to rebind a pointer because it is done differently in C++11 and C++03. This patch introduces the __rebind_pointer utility to clean this up. llvm-svn: 245802
-
- Aug 19, 2015
-
-
Eric Fiselier authored
Summary: After putting this question up on cfe-dev I have decided that it would be best to allow the use of `<atomic>` in C++03. Although static initialization is a concern the syntax required to get it is C++11 only. Meaning that C++11 constant static initialization cannot silently break in C++03, it will always cause a syntax error. Furthermore `ATOMIC_VAR_INIT` and `ATOMIC_FLAG_INIT` remain defined in C++03 even though they cannot be used because C++03 usages will cause better error messages. The main change in this patch is to replace `__has_feature(cxx_atomic)`, which only returns true when C++ >= 11, to `__has_extension(c_atomic)` which returns true whenever clang supports the required atomic builtins. This patch adds the following macros: * `_LIBCPP_HAS_C_ATOMIC_IMP` - Defined on clang versions which provide the C `_Atomic` keyword. * `_LIBCPP_HAS_GCC_ATOMIC_IMP` - Defined on GCC > 4.7. We must use the fallback atomic implementation. * `_LIBCPP_HAS_NO_ATOMIC_HEADER` - Defined when it is not safe to include `<atomic>`. `_LIBCPP_HAS_C_ATOMIC_IMP` and `_LIBCPP_HAS_GCC_ATOMIC_IMP` are mutually exclusive, only one should be defined. If neither is defined then `<atomic>` is not implemented and including `<atomic>` will issue an error. Reviewers: chandlerc, jroelofs, mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11555 llvm-svn: 245463
-
- Aug 18, 2015
-
-
Marshall Clow authored
llvm-svn: 245336
-
Marshall Clow authored
implement more of N4258 - Cleaning up noexcept in the standard library. Specifically add new noexcept stuff to vector and string's move-assignment operations llvm-svn: 245330
-
- Jul 18, 2015
-
-
Eric Fiselier authored
Although CMake adds warning flags, they are ignored in the libc++ headers because the headers '#pragma system header' themselves. This patch disables the system header pragma when building libc++ and fixes the warnings that arose. The warnings fixed were: 1. <memory> - anonymous structs are a GNU extension 2. <functional> - anonymous structs are a GNU extension. 3. <__hash_table> - Embedded preprocessor directives have undefined behavior. 4. <string> - Definition is missing noexcept from declaration. 5. <__std_stream> - Unused variable. llvm-svn: 242623
-
- Jul 16, 2015
-
-
Marshall Clow authored
Make sure that __libcpp_compressed_pair_imp default-constructs its' members, rather than value-initializing them. Fixes PR#24137 llvm-svn: 242377
-
- Jul 13, 2015
-
-
Marshall Clow authored
Implement the first part of N4258: 'Cleaning up noexcept in the Library'. This patch deals with swapping containers, and implements a more strict noexcept specification (a conforming extension) than the standard mandates. llvm-svn: 242056
-
- Jul 07, 2015
-
-
Eric Fiselier authored
Summary: In some places in libc++ we need to use the `__atomic_*` builtins. This patch adds a header that provides access to those builtins in a uniform way from within the dylib source. If the compiler building the dylib does not support these builtins then a warning is issued. Only relaxed loads are needed within the headers. A singe function to do these relaxed loads has been added to `<memory>`. This patch applies the new atomic builtins to `__shared_count` and `call_once`. Reviewers: mclow.lists Subscribers: majnemer, jroelofs, cfe-commits Differential Revision: http://reviews.llvm.org/D10406 llvm-svn: 241532
-
- Jul 01, 2015
-
-
Marshall Clow authored
Noticed that std::allocator<const T> was missing the definition for is_always_equal. Fixed this, and added a test for it. llvm-svn: 241190
-
- Jun 19, 2015
-
-
Marshall Clow authored
llvm-svn: 240163
-
Marshall Clow authored
llvm-svn: 240139
-
Marshall Clow authored
llvm-svn: 240136
-
- Jun 13, 2015
-
-
Eric Fiselier authored
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
-
- Jun 02, 2015
-
-
Marshall Clow authored
llvm-svn: 238848
-
Marshall Clow authored
llvm-svn: 238828
-