[libcxx] r332996 - Change the names of two private methods: allocate -> __vallocate and deallocate -> __vdeallocate. NFC. This change triggered by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61806, which shows up when we implement deduction guides for the container adaptors.The names have a 'v' in them because WIN32 has a macro named __deallocate. (sigh).
Marshall Clow via cfe-commits
cfe-commits at lists.llvm.org
Tue May 22 09:20:28 PDT 2018
Author: marshall
Date: Tue May 22 09:20:28 2018
New Revision: 332996
URL: http://llvm.org/viewvc/llvm-project?rev=332996&view=rev
Log:
Change the names of two private methods: allocate -> __vallocate and deallocate -> __vdeallocate. NFC. This change triggered by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61806, which shows up when we implement deduction guides for the container adaptors.The names have a 'v' in them because WIN32 has a macro named __deallocate. (sigh).
Modified:
libcxx/trunk/include/vector
Modified: libcxx/trunk/include/vector
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/vector?rev=332996&r1=332995&r2=332996&view=diff
==============================================================================
--- libcxx/trunk/include/vector (original)
+++ libcxx/trunk/include/vector Tue May 22 09:20:28 2018
@@ -781,8 +781,8 @@ public:
private:
_LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
_LIBCPP_INLINE_VISIBILITY void __invalidate_iterators_past(pointer __new_last);
- void allocate(size_type __n);
- void deallocate() _NOEXCEPT;
+ void __vallocate(size_type __n);
+ void __vdeallocate() _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const;
void __construct_at_end(size_type __n);
_LIBCPP_INLINE_VISIBILITY
@@ -951,7 +951,7 @@ vector<_Tp, _Allocator>::__swap_out_circ
// Postcondition: size() == 0
template <class _Tp, class _Allocator>
void
-vector<_Tp, _Allocator>::allocate(size_type __n)
+vector<_Tp, _Allocator>::__vallocate(size_type __n)
{
if (__n > max_size())
this->__throw_length_error();
@@ -962,7 +962,7 @@ vector<_Tp, _Allocator>::allocate(size_t
template <class _Tp, class _Allocator>
void
-vector<_Tp, _Allocator>::deallocate() _NOEXCEPT
+vector<_Tp, _Allocator>::__vdeallocate() _NOEXCEPT
{
if (this->__begin_ != nullptr)
{
@@ -1098,7 +1098,7 @@ vector<_Tp, _Allocator>::vector(size_typ
#endif
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n);
}
}
@@ -1113,7 +1113,7 @@ vector<_Tp, _Allocator>::vector(size_typ
#endif
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n);
}
}
@@ -1127,7 +1127,7 @@ vector<_Tp, _Allocator>::vector(size_typ
#endif
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n, __x);
}
}
@@ -1141,7 +1141,7 @@ vector<_Tp, _Allocator>::vector(size_typ
#endif
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n, __x);
}
}
@@ -1195,7 +1195,7 @@ vector<_Tp, _Allocator>::vector(_Forward
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__first, __last, __n);
}
}
@@ -1215,7 +1215,7 @@ vector<_Tp, _Allocator>::vector(_Forward
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__first, __last, __n);
}
}
@@ -1230,7 +1230,7 @@ vector<_Tp, _Allocator>::vector(const ve
size_type __n = __x.size();
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__x.__begin_, __x.__end_, __n);
}
}
@@ -1245,7 +1245,7 @@ vector<_Tp, _Allocator>::vector(const ve
size_type __n = __x.size();
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__x.__begin_, __x.__end_, __n);
}
}
@@ -1306,7 +1306,7 @@ vector<_Tp, _Allocator>::vector(initiali
#endif
if (__il.size() > 0)
{
- allocate(__il.size());
+ __vallocate(__il.size());
__construct_at_end(__il.begin(), __il.end(), __il.size());
}
}
@@ -1321,7 +1321,7 @@ vector<_Tp, _Allocator>::vector(initiali
#endif
if (__il.size() > 0)
{
- allocate(__il.size());
+ __vallocate(__il.size());
__construct_at_end(__il.begin(), __il.end(), __il.size());
}
}
@@ -1356,7 +1356,7 @@ void
vector<_Tp, _Allocator>::__move_assign(vector& __c, true_type)
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
{
- deallocate();
+ __vdeallocate();
__base::__move_assign_alloc(__c); // this can throw
this->__begin_ = __c.__begin_;
this->__end_ = __c.__end_;
@@ -1431,8 +1431,8 @@ vector<_Tp, _Allocator>::assign(_Forward
}
else
{
- deallocate();
- allocate(__recommend(__new_size));
+ __vdeallocate();
+ __vallocate(__recommend(__new_size));
__construct_at_end(__first, __last, __new_size);
}
__invalidate_all_iterators();
@@ -1453,8 +1453,8 @@ vector<_Tp, _Allocator>::assign(size_typ
}
else
{
- deallocate();
- allocate(__recommend(static_cast<size_type>(__n)));
+ __vdeallocate();
+ __vallocate(__recommend(static_cast<size_type>(__n)));
__construct_at_end(__n, __u);
}
__invalidate_all_iterators();
@@ -2437,8 +2437,8 @@ public:
private:
_LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
- void allocate(size_type __n);
- void deallocate() _NOEXCEPT;
+ void __vallocate(size_type __n);
+ void __vdeallocate() _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
static size_type __align_it(size_type __new_size) _NOEXCEPT
{return __new_size + (__bits_per_word-1) & ~((size_type)__bits_per_word-1);};
@@ -2476,7 +2476,7 @@ private:
void __copy_assign_alloc(const vector& __c, true_type)
{
if (__alloc() != __c.__alloc())
- deallocate();
+ __vdeallocate();
__alloc() = __c.__alloc();
}
@@ -2532,7 +2532,7 @@ vector<bool, _Allocator>::__invalidate_a
// Postcondition: size() == 0
template <class _Allocator>
void
-vector<bool, _Allocator>::allocate(size_type __n)
+vector<bool, _Allocator>::__vallocate(size_type __n)
{
if (__n > max_size())
this->__throw_length_error();
@@ -2544,7 +2544,7 @@ vector<bool, _Allocator>::allocate(size_
template <class _Allocator>
void
-vector<bool, _Allocator>::deallocate() _NOEXCEPT
+vector<bool, _Allocator>::__vdeallocate() _NOEXCEPT
{
if (this->__begin_ != nullptr)
{
@@ -2641,7 +2641,7 @@ vector<bool, _Allocator>::vector(size_ty
{
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n, false);
}
}
@@ -2655,7 +2655,7 @@ vector<bool, _Allocator>::vector(size_ty
{
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n, false);
}
}
@@ -2669,7 +2669,7 @@ vector<bool, _Allocator>::vector(size_ty
{
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n, __x);
}
}
@@ -2682,7 +2682,7 @@ vector<bool, _Allocator>::vector(size_ty
{
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__n, __x);
}
}
@@ -2752,7 +2752,7 @@ vector<bool, _Allocator>::vector(_Forwar
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__first, __last);
}
}
@@ -2768,7 +2768,7 @@ vector<bool, _Allocator>::vector(_Forwar
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__first, __last);
}
}
@@ -2784,7 +2784,7 @@ vector<bool, _Allocator>::vector(initial
size_type __n = static_cast<size_type>(__il.size());
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__il.begin(), __il.end());
}
}
@@ -2798,7 +2798,7 @@ vector<bool, _Allocator>::vector(initial
size_type __n = static_cast<size_type>(__il.size());
if (__n > 0)
{
- allocate(__n);
+ __vallocate(__n);
__construct_at_end(__il.begin(), __il.end());
}
}
@@ -2821,7 +2821,7 @@ vector<bool, _Allocator>::vector(const v
{
if (__v.size() > 0)
{
- allocate(__v.size());
+ __vallocate(__v.size());
__construct_at_end(__v.begin(), __v.end());
}
}
@@ -2834,7 +2834,7 @@ vector<bool, _Allocator>::vector(const v
{
if (__v.size() > 0)
{
- allocate(__v.size());
+ __vallocate(__v.size());
__construct_at_end(__v.begin(), __v.end());
}
}
@@ -2850,8 +2850,8 @@ vector<bool, _Allocator>::operator=(cons
{
if (__v.__size_ > capacity())
{
- deallocate();
- allocate(__v.__size_);
+ __vdeallocate();
+ __vallocate(__v.__size_);
}
_VSTD::copy(__v.__begin_, __v.__begin_ + __external_cap_to_internal(__v.__size_), __begin_);
}
@@ -2895,7 +2895,7 @@ vector<bool, _Allocator>::vector(vector&
}
else if (__v.size() > 0)
{
- allocate(__v.size());
+ __vallocate(__v.size());
__construct_at_end(__v.begin(), __v.end());
}
}
@@ -2926,7 +2926,7 @@ void
vector<bool, _Allocator>::__move_assign(vector& __c, true_type)
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
{
- deallocate();
+ __vdeallocate();
__move_assign_alloc(__c);
this->__begin_ = __c.__begin_;
this->__size_ = __c.__size_;
@@ -2991,8 +2991,8 @@ vector<bool, _Allocator>::assign(_Forwar
{
if (__n > capacity())
{
- deallocate();
- allocate(__n);
+ __vdeallocate();
+ __vallocate(__n);
}
__construct_at_end(__first, __last);
}
@@ -3005,7 +3005,7 @@ vector<bool, _Allocator>::reserve(size_t
if (__n > capacity())
{
vector __v(this->__alloc());
- __v.allocate(__n);
+ __v.__vallocate(__n);
__v.__construct_at_end(this->begin(), this->end());
swap(__v);
__invalidate_all_iterators();
More information about the cfe-commits
mailing list