mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
[C++11] Remove the R-value reference #if usage from the ADT and Support
libraries. It is now always 1 in LLVM builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202580 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -284,12 +284,10 @@ public:
|
|||||||
initSlowCase(that);
|
initSlowCase(that);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
/// \brief Move Constructor.
|
/// \brief Move Constructor.
|
||||||
APInt(APInt &&that) : BitWidth(that.BitWidth), VAL(that.VAL) {
|
APInt(APInt &&that) : BitWidth(that.BitWidth), VAL(that.VAL) {
|
||||||
that.BitWidth = 0;
|
that.BitWidth = 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/// \brief Destructor.
|
/// \brief Destructor.
|
||||||
~APInt() {
|
~APInt() {
|
||||||
@@ -656,7 +654,6 @@ public:
|
|||||||
return AssignSlowCase(RHS);
|
return AssignSlowCase(RHS);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
/// @brief Move assignment operator.
|
/// @brief Move assignment operator.
|
||||||
APInt &operator=(APInt &&that) {
|
APInt &operator=(APInt &&that) {
|
||||||
if (!isSingleWord())
|
if (!isSingleWord())
|
||||||
@@ -669,7 +666,6 @@ public:
|
|||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/// \brief Assignment operator.
|
/// \brief Assignment operator.
|
||||||
///
|
///
|
||||||
|
@@ -98,12 +98,10 @@ public:
|
|||||||
std::memcpy(Bits, RHS.Bits, Capacity * sizeof(BitWord));
|
std::memcpy(Bits, RHS.Bits, Capacity * sizeof(BitWord));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
BitVector(BitVector &&RHS)
|
BitVector(BitVector &&RHS)
|
||||||
: Bits(RHS.Bits), Size(RHS.Size), Capacity(RHS.Capacity) {
|
: Bits(RHS.Bits), Size(RHS.Size), Capacity(RHS.Capacity) {
|
||||||
RHS.Bits = 0;
|
RHS.Bits = 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
~BitVector() {
|
~BitVector() {
|
||||||
std::free(Bits);
|
std::free(Bits);
|
||||||
@@ -461,7 +459,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
const BitVector &operator=(BitVector &&RHS) {
|
const BitVector &operator=(BitVector &&RHS) {
|
||||||
if (this == &RHS) return *this;
|
if (this == &RHS) return *this;
|
||||||
|
|
||||||
@@ -474,7 +471,6 @@ public:
|
|||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void swap(BitVector &RHS) {
|
void swap(BitVector &RHS) {
|
||||||
std::swap(Bits, RHS.Bits);
|
std::swap(Bits, RHS.Bits);
|
||||||
|
@@ -161,7 +161,6 @@ public:
|
|||||||
return std::make_pair(iterator(TheBucket, getBucketsEnd(), true), true);
|
return std::make_pair(iterator(TheBucket, getBucketsEnd(), true), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
// Inserts key,value pair into the map if the key isn't already in the map.
|
// Inserts key,value pair into the map if the key isn't already in the map.
|
||||||
// If the key is already in the map, it returns false and doesn't update the
|
// If the key is already in the map, it returns false and doesn't update the
|
||||||
// value.
|
// value.
|
||||||
@@ -177,8 +176,7 @@ public:
|
|||||||
TheBucket);
|
TheBucket);
|
||||||
return std::make_pair(iterator(TheBucket, getBucketsEnd(), true), true);
|
return std::make_pair(iterator(TheBucket, getBucketsEnd(), true), true);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/// insert - Range insertion of pairs.
|
/// insert - Range insertion of pairs.
|
||||||
template<typename InputIt>
|
template<typename InputIt>
|
||||||
void insert(InputIt I, InputIt E) {
|
void insert(InputIt I, InputIt E) {
|
||||||
@@ -218,7 +216,6 @@ public:
|
|||||||
return FindAndConstruct(Key).second;
|
return FindAndConstruct(Key).second;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
value_type& FindAndConstruct(KeyT &&Key) {
|
value_type& FindAndConstruct(KeyT &&Key) {
|
||||||
BucketT *TheBucket;
|
BucketT *TheBucket;
|
||||||
if (LookupBucketFor(Key, TheBucket))
|
if (LookupBucketFor(Key, TheBucket))
|
||||||
@@ -230,7 +227,6 @@ public:
|
|||||||
ValueT &operator[](KeyT &&Key) {
|
ValueT &operator[](KeyT &&Key) {
|
||||||
return FindAndConstruct(std::move(Key)).second;
|
return FindAndConstruct(std::move(Key)).second;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/// isPointerIntoBucketsArray - Return true if the specified pointer points
|
/// isPointerIntoBucketsArray - Return true if the specified pointer points
|
||||||
/// somewhere into the DenseMap's array of buckets (i.e. either to a key or
|
/// somewhere into the DenseMap's array of buckets (i.e. either to a key or
|
||||||
@@ -403,7 +399,6 @@ private:
|
|||||||
return TheBucket;
|
return TheBucket;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
BucketT *InsertIntoBucket(const KeyT &Key, ValueT &&Value,
|
BucketT *InsertIntoBucket(const KeyT &Key, ValueT &&Value,
|
||||||
BucketT *TheBucket) {
|
BucketT *TheBucket) {
|
||||||
TheBucket = InsertIntoBucketImpl(Key, TheBucket);
|
TheBucket = InsertIntoBucketImpl(Key, TheBucket);
|
||||||
@@ -420,7 +415,6 @@ private:
|
|||||||
new (&TheBucket->second) ValueT(std::move(Value));
|
new (&TheBucket->second) ValueT(std::move(Value));
|
||||||
return TheBucket;
|
return TheBucket;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
BucketT *InsertIntoBucketImpl(const KeyT &Key, BucketT *TheBucket) {
|
BucketT *InsertIntoBucketImpl(const KeyT &Key, BucketT *TheBucket) {
|
||||||
// If the load of the hash table is more than 3/4, or if fewer than 1/8 of
|
// If the load of the hash table is more than 3/4, or if fewer than 1/8 of
|
||||||
@@ -555,12 +549,10 @@ public:
|
|||||||
copyFrom(other);
|
copyFrom(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
DenseMap(DenseMap &&other) : BaseT() {
|
DenseMap(DenseMap &&other) : BaseT() {
|
||||||
init(0);
|
init(0);
|
||||||
swap(other);
|
swap(other);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
template<typename InputIt>
|
template<typename InputIt>
|
||||||
DenseMap(const InputIt &I, const InputIt &E) {
|
DenseMap(const InputIt &I, const InputIt &E) {
|
||||||
@@ -585,7 +577,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
DenseMap& operator=(DenseMap &&other) {
|
DenseMap& operator=(DenseMap &&other) {
|
||||||
this->destroyAll();
|
this->destroyAll();
|
||||||
operator delete(Buckets);
|
operator delete(Buckets);
|
||||||
@@ -593,7 +584,6 @@ public:
|
|||||||
swap(other);
|
swap(other);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void copyFrom(const DenseMap& other) {
|
void copyFrom(const DenseMap& other) {
|
||||||
this->destroyAll();
|
this->destroyAll();
|
||||||
@@ -719,12 +709,10 @@ public:
|
|||||||
copyFrom(other);
|
copyFrom(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
SmallDenseMap(SmallDenseMap &&other) : BaseT() {
|
SmallDenseMap(SmallDenseMap &&other) : BaseT() {
|
||||||
init(0);
|
init(0);
|
||||||
swap(other);
|
swap(other);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
template<typename InputIt>
|
template<typename InputIt>
|
||||||
SmallDenseMap(const InputIt &I, const InputIt &E) {
|
SmallDenseMap(const InputIt &I, const InputIt &E) {
|
||||||
@@ -814,7 +802,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
SmallDenseMap& operator=(SmallDenseMap &&other) {
|
SmallDenseMap& operator=(SmallDenseMap &&other) {
|
||||||
this->destroyAll();
|
this->destroyAll();
|
||||||
deallocateBuckets();
|
deallocateBuckets();
|
||||||
@@ -822,7 +809,6 @@ public:
|
|||||||
swap(other);
|
swap(other);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void copyFrom(const SmallDenseMap& other) {
|
void copyFrom(const SmallDenseMap& other) {
|
||||||
this->destroyAll();
|
this->destroyAll();
|
||||||
|
@@ -123,7 +123,6 @@ namespace llvm {
|
|||||||
retain();
|
retain();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
IntrusiveRefCntPtr(IntrusiveRefCntPtr&& S) : Obj(S.Obj) {
|
IntrusiveRefCntPtr(IntrusiveRefCntPtr&& S) : Obj(S.Obj) {
|
||||||
S.Obj = 0;
|
S.Obj = 0;
|
||||||
}
|
}
|
||||||
@@ -132,7 +131,6 @@ namespace llvm {
|
|||||||
IntrusiveRefCntPtr(IntrusiveRefCntPtr<X>&& S) : Obj(S.getPtr()) {
|
IntrusiveRefCntPtr(IntrusiveRefCntPtr<X>&& S) : Obj(S.getPtr()) {
|
||||||
S.Obj = 0;
|
S.Obj = 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
template <class X>
|
template <class X>
|
||||||
IntrusiveRefCntPtr(const IntrusiveRefCntPtr<X>& S)
|
IntrusiveRefCntPtr(const IntrusiveRefCntPtr<X>& S)
|
||||||
|
@@ -20,10 +20,7 @@
|
|||||||
#include "llvm/Support/AlignOf.h"
|
#include "llvm/Support/AlignOf.h"
|
||||||
#include "llvm/Support/Compiler.h"
|
#include "llvm/Support/Compiler.h"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
@@ -42,7 +39,6 @@ public:
|
|||||||
new (storage.buffer) T(*O);
|
new (storage.buffer) T(*O);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
Optional(T &&y) : hasVal(true) {
|
Optional(T &&y) : hasVal(true) {
|
||||||
new (storage.buffer) T(std::forward<T>(y));
|
new (storage.buffer) T(std::forward<T>(y));
|
||||||
}
|
}
|
||||||
@@ -70,7 +66,6 @@ public:
|
|||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline Optional create(const T* y) {
|
static inline Optional create(const T* y) {
|
||||||
return y ? Optional(*y) : Optional();
|
return y ? Optional(*y) : Optional();
|
||||||
|
@@ -32,14 +32,12 @@ class OwningPtr {
|
|||||||
public:
|
public:
|
||||||
explicit OwningPtr(T *P = 0) : Ptr(P) {}
|
explicit OwningPtr(T *P = 0) : Ptr(P) {}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
OwningPtr(OwningPtr &&Other) : Ptr(Other.take()) {}
|
OwningPtr(OwningPtr &&Other) : Ptr(Other.take()) {}
|
||||||
|
|
||||||
OwningPtr &operator=(OwningPtr &&Other) {
|
OwningPtr &operator=(OwningPtr &&Other) {
|
||||||
reset(Other.take());
|
reset(Other.take());
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
~OwningPtr() {
|
~OwningPtr() {
|
||||||
delete Ptr;
|
delete Ptr;
|
||||||
@@ -96,14 +94,12 @@ class OwningArrayPtr {
|
|||||||
public:
|
public:
|
||||||
explicit OwningArrayPtr(T *P = 0) : Ptr(P) {}
|
explicit OwningArrayPtr(T *P = 0) : Ptr(P) {}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
OwningArrayPtr(OwningArrayPtr &&Other) : Ptr(Other.take()) {}
|
OwningArrayPtr(OwningArrayPtr &&Other) : Ptr(Other.take()) {}
|
||||||
|
|
||||||
OwningArrayPtr &operator=(OwningArrayPtr &&Other) {
|
OwningArrayPtr &operator=(OwningArrayPtr &&Other) {
|
||||||
reset(Other.take());
|
reset(Other.take());
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
~OwningArrayPtr() {
|
~OwningArrayPtr() {
|
||||||
delete [] Ptr;
|
delete [] Ptr;
|
||||||
|
@@ -153,11 +153,9 @@ public:
|
|||||||
switchToLarge(new BitVector(*RHS.getPointer()));
|
switchToLarge(new BitVector(*RHS.getPointer()));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
SmallBitVector(SmallBitVector &&RHS) : X(RHS.X) {
|
SmallBitVector(SmallBitVector &&RHS) : X(RHS.X) {
|
||||||
RHS.X = 1;
|
RHS.X = 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
~SmallBitVector() {
|
~SmallBitVector() {
|
||||||
if (!isSmall())
|
if (!isSmall())
|
||||||
@@ -506,7 +504,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
const SmallBitVector &operator=(SmallBitVector &&RHS) {
|
const SmallBitVector &operator=(SmallBitVector &&RHS) {
|
||||||
if (this != &RHS) {
|
if (this != &RHS) {
|
||||||
clear();
|
clear();
|
||||||
@@ -514,7 +511,6 @@ public:
|
|||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void swap(SmallBitVector &RHS) {
|
void swap(SmallBitVector &RHS) {
|
||||||
std::swap(X, RHS.X);
|
std::swap(X, RHS.X);
|
||||||
|
@@ -62,10 +62,8 @@ protected:
|
|||||||
|
|
||||||
// Helpers to copy and move construct a SmallPtrSet.
|
// Helpers to copy and move construct a SmallPtrSet.
|
||||||
SmallPtrSetImplBase(const void **SmallStorage, const SmallPtrSetImplBase &that);
|
SmallPtrSetImplBase(const void **SmallStorage, const SmallPtrSetImplBase &that);
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
SmallPtrSetImplBase(const void **SmallStorage, unsigned SmallSize,
|
SmallPtrSetImplBase(const void **SmallStorage, unsigned SmallSize,
|
||||||
SmallPtrSetImplBase &&that);
|
SmallPtrSetImplBase &&that);
|
||||||
#endif
|
|
||||||
explicit SmallPtrSetImplBase(const void **SmallStorage, unsigned SmallSize) :
|
explicit SmallPtrSetImplBase(const void **SmallStorage, unsigned SmallSize) :
|
||||||
SmallArray(SmallStorage), CurArray(SmallStorage), CurArraySize(SmallSize) {
|
SmallArray(SmallStorage), CurArray(SmallStorage), CurArraySize(SmallSize) {
|
||||||
assert(SmallSize && (SmallSize & (SmallSize-1)) == 0 &&
|
assert(SmallSize && (SmallSize & (SmallSize-1)) == 0 &&
|
||||||
@@ -139,9 +137,7 @@ protected:
|
|||||||
void swap(SmallPtrSetImplBase &RHS);
|
void swap(SmallPtrSetImplBase &RHS);
|
||||||
|
|
||||||
void CopyFrom(const SmallPtrSetImplBase &RHS);
|
void CopyFrom(const SmallPtrSetImplBase &RHS);
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
void MoveFrom(unsigned SmallSize, SmallPtrSetImplBase &&RHS);
|
void MoveFrom(unsigned SmallSize, SmallPtrSetImplBase &&RHS);
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// SmallPtrSetIteratorImpl - This is the common base class shared between all
|
/// SmallPtrSetIteratorImpl - This is the common base class shared between all
|
||||||
@@ -247,11 +243,9 @@ protected:
|
|||||||
// Constructors that forward to the base.
|
// Constructors that forward to the base.
|
||||||
SmallPtrSetImpl(const void **SmallStorage, const SmallPtrSetImpl &that)
|
SmallPtrSetImpl(const void **SmallStorage, const SmallPtrSetImpl &that)
|
||||||
: SmallPtrSetImplBase(SmallStorage, that) {}
|
: SmallPtrSetImplBase(SmallStorage, that) {}
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
SmallPtrSetImpl(const void **SmallStorage, unsigned SmallSize,
|
SmallPtrSetImpl(const void **SmallStorage, unsigned SmallSize,
|
||||||
SmallPtrSetImpl &&that)
|
SmallPtrSetImpl &&that)
|
||||||
: SmallPtrSetImplBase(SmallStorage, SmallSize, std::move(that)) {}
|
: SmallPtrSetImplBase(SmallStorage, SmallSize, std::move(that)) {}
|
||||||
#endif
|
|
||||||
explicit SmallPtrSetImpl(const void **SmallStorage, unsigned SmallSize)
|
explicit SmallPtrSetImpl(const void **SmallStorage, unsigned SmallSize)
|
||||||
: SmallPtrSetImplBase(SmallStorage, SmallSize) {}
|
: SmallPtrSetImplBase(SmallStorage, SmallSize) {}
|
||||||
|
|
||||||
@@ -304,10 +298,8 @@ class SmallPtrSet : public SmallPtrSetImpl<PtrType> {
|
|||||||
public:
|
public:
|
||||||
SmallPtrSet() : BaseT(SmallStorage, SmallSizePowTwo) {}
|
SmallPtrSet() : BaseT(SmallStorage, SmallSizePowTwo) {}
|
||||||
SmallPtrSet(const SmallPtrSet &that) : BaseT(SmallStorage, that) {}
|
SmallPtrSet(const SmallPtrSet &that) : BaseT(SmallStorage, that) {}
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
SmallPtrSet(SmallPtrSet &&that)
|
SmallPtrSet(SmallPtrSet &&that)
|
||||||
: BaseT(SmallStorage, SmallSizePowTwo, std::move(that)) {}
|
: BaseT(SmallStorage, SmallSizePowTwo, std::move(that)) {}
|
||||||
#endif
|
|
||||||
|
|
||||||
template<typename It>
|
template<typename It>
|
||||||
SmallPtrSet(It I, It E) : BaseT(SmallStorage, SmallSizePowTwo) {
|
SmallPtrSet(It I, It E) : BaseT(SmallStorage, SmallSizePowTwo) {
|
||||||
@@ -321,14 +313,12 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
SmallPtrSet<PtrType, SmallSize>&
|
SmallPtrSet<PtrType, SmallSize>&
|
||||||
operator=(SmallPtrSet<PtrType, SmallSize> &&RHS) {
|
operator=(SmallPtrSet<PtrType, SmallSize> &&RHS) {
|
||||||
if (&RHS != this)
|
if (&RHS != this)
|
||||||
this->MoveFrom(SmallSizePowTwo, std::move(RHS));
|
this->MoveFrom(SmallSizePowTwo, std::move(RHS));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/// swap - Swaps the elements of two sets.
|
/// swap - Swaps the elements of two sets.
|
||||||
void swap(SmallPtrSet<PtrType, SmallSize> &RHS) {
|
void swap(SmallPtrSet<PtrType, SmallSize> &RHS) {
|
||||||
|
@@ -183,13 +183,9 @@ protected:
|
|||||||
/// std::move, but not all stdlibs actually provide that.
|
/// std::move, but not all stdlibs actually provide that.
|
||||||
template<typename It1, typename It2>
|
template<typename It1, typename It2>
|
||||||
static It2 move(It1 I, It1 E, It2 Dest) {
|
static It2 move(It1 I, It1 E, It2 Dest) {
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
for (; I != E; ++I, ++Dest)
|
for (; I != E; ++I, ++Dest)
|
||||||
*Dest = ::std::move(*I);
|
*Dest = ::std::move(*I);
|
||||||
return Dest;
|
return Dest;
|
||||||
#else
|
|
||||||
return ::std::copy(I, E, Dest);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// move_backward - Use move-assignment to move the range
|
/// move_backward - Use move-assignment to move the range
|
||||||
@@ -198,25 +194,17 @@ protected:
|
|||||||
/// std::move_backward, but not all stdlibs actually provide that.
|
/// std::move_backward, but not all stdlibs actually provide that.
|
||||||
template<typename It1, typename It2>
|
template<typename It1, typename It2>
|
||||||
static It2 move_backward(It1 I, It1 E, It2 Dest) {
|
static It2 move_backward(It1 I, It1 E, It2 Dest) {
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
while (I != E)
|
while (I != E)
|
||||||
*--Dest = ::std::move(*--E);
|
*--Dest = ::std::move(*--E);
|
||||||
return Dest;
|
return Dest;
|
||||||
#else
|
|
||||||
return ::std::copy_backward(I, E, Dest);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// uninitialized_move - Move the range [I, E) into the uninitialized
|
/// uninitialized_move - Move the range [I, E) into the uninitialized
|
||||||
/// memory starting with "Dest", constructing elements as needed.
|
/// memory starting with "Dest", constructing elements as needed.
|
||||||
template<typename It1, typename It2>
|
template<typename It1, typename It2>
|
||||||
static void uninitialized_move(It1 I, It1 E, It2 Dest) {
|
static void uninitialized_move(It1 I, It1 E, It2 Dest) {
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
for (; I != E; ++I, ++Dest)
|
for (; I != E; ++I, ++Dest)
|
||||||
::new ((void*) &*Dest) T(::std::move(*I));
|
::new ((void*) &*Dest) T(::std::move(*I));
|
||||||
#else
|
|
||||||
::std::uninitialized_copy(I, E, Dest);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// uninitialized_copy - Copy the range [I, E) onto the uninitialized
|
/// uninitialized_copy - Copy the range [I, E) onto the uninitialized
|
||||||
@@ -244,7 +232,6 @@ public:
|
|||||||
goto Retry;
|
goto Retry;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
void push_back(T &&Elt) {
|
void push_back(T &&Elt) {
|
||||||
if (this->EndX < this->CapacityX) {
|
if (this->EndX < this->CapacityX) {
|
||||||
Retry:
|
Retry:
|
||||||
@@ -255,8 +242,7 @@ public:
|
|||||||
this->grow();
|
this->grow();
|
||||||
goto Retry;
|
goto Retry;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void pop_back() {
|
void pop_back() {
|
||||||
this->setEnd(this->end()-1);
|
this->setEnd(this->end()-1);
|
||||||
this->end()->~T();
|
this->end()->~T();
|
||||||
@@ -428,11 +414,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() {
|
T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() {
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
T Result = ::std::move(this->back());
|
T Result = ::std::move(this->back());
|
||||||
#else
|
|
||||||
T Result = this->back();
|
|
||||||
#endif
|
|
||||||
this->pop_back();
|
this->pop_back();
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
@@ -501,7 +483,6 @@ public:
|
|||||||
return(N);
|
return(N);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
iterator insert(iterator I, T &&Elt) {
|
iterator insert(iterator I, T &&Elt) {
|
||||||
if (I == this->end()) { // Important special case for empty vector.
|
if (I == this->end()) { // Important special case for empty vector.
|
||||||
this->push_back(::std::move(Elt));
|
this->push_back(::std::move(Elt));
|
||||||
@@ -532,7 +513,6 @@ public:
|
|||||||
I = this->begin()+EltNo;
|
I = this->begin()+EltNo;
|
||||||
goto Retry;
|
goto Retry;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
iterator insert(iterator I, const T &Elt) {
|
iterator insert(iterator I, const T &Elt) {
|
||||||
if (I == this->end()) { // Important special case for empty vector.
|
if (I == this->end()) { // Important special case for empty vector.
|
||||||
@@ -673,9 +653,7 @@ public:
|
|||||||
|
|
||||||
SmallVectorImpl &operator=(const SmallVectorImpl &RHS);
|
SmallVectorImpl &operator=(const SmallVectorImpl &RHS);
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
SmallVectorImpl &operator=(SmallVectorImpl &&RHS);
|
SmallVectorImpl &operator=(SmallVectorImpl &&RHS);
|
||||||
#endif
|
|
||||||
|
|
||||||
bool operator==(const SmallVectorImpl &RHS) const {
|
bool operator==(const SmallVectorImpl &RHS) const {
|
||||||
if (this->size() != RHS.size()) return false;
|
if (this->size() != RHS.size()) return false;
|
||||||
@@ -793,7 +771,6 @@ SmallVectorImpl<T> &SmallVectorImpl<T>::
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
SmallVectorImpl<T> &SmallVectorImpl<T>::operator=(SmallVectorImpl<T> &&RHS) {
|
SmallVectorImpl<T> &SmallVectorImpl<T>::operator=(SmallVectorImpl<T> &&RHS) {
|
||||||
// Avoid self-assignment.
|
// Avoid self-assignment.
|
||||||
@@ -855,7 +832,6 @@ SmallVectorImpl<T> &SmallVectorImpl<T>::operator=(SmallVectorImpl<T> &&RHS) {
|
|||||||
RHS.clear();
|
RHS.clear();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/// Storage for the SmallVector elements which aren't contained in
|
/// Storage for the SmallVector elements which aren't contained in
|
||||||
/// SmallVectorTemplateCommon. There are 'N-1' elements here. The remaining '1'
|
/// SmallVectorTemplateCommon. There are 'N-1' elements here. The remaining '1'
|
||||||
@@ -904,7 +880,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
SmallVector(SmallVector &&RHS) : SmallVectorImpl<T>(N) {
|
SmallVector(SmallVector &&RHS) : SmallVectorImpl<T>(N) {
|
||||||
if (!RHS.empty())
|
if (!RHS.empty())
|
||||||
SmallVectorImpl<T>::operator=(::std::move(RHS));
|
SmallVectorImpl<T>::operator=(::std::move(RHS));
|
||||||
@@ -914,8 +889,6 @@ public:
|
|||||||
SmallVectorImpl<T>::operator=(::std::move(RHS));
|
SmallVectorImpl<T>::operator=(::std::move(RHS));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T, unsigned N>
|
template<typename T, unsigned N>
|
||||||
|
@@ -70,7 +70,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
TinyPtrVector(TinyPtrVector &&RHS) : Val(RHS.Val) {
|
TinyPtrVector(TinyPtrVector &&RHS) : Val(RHS.Val) {
|
||||||
RHS.Val = (EltTy)0;
|
RHS.Val = (EltTy)0;
|
||||||
}
|
}
|
||||||
@@ -98,7 +97,6 @@ public:
|
|||||||
RHS.Val = (EltTy)0;
|
RHS.Val = (EltTy)0;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// implicit conversion operator to ArrayRef.
|
// implicit conversion operator to ArrayRef.
|
||||||
operator ArrayRef<EltTy>() const {
|
operator ArrayRef<EltTy>() const {
|
||||||
|
@@ -40,9 +40,7 @@ template <typename T> class polymorphic_ptr {
|
|||||||
public:
|
public:
|
||||||
polymorphic_ptr(T *ptr = 0) : ptr(ptr) {}
|
polymorphic_ptr(T *ptr = 0) : ptr(ptr) {}
|
||||||
polymorphic_ptr(const polymorphic_ptr &arg) : ptr(arg ? arg->clone() : 0) {}
|
polymorphic_ptr(const polymorphic_ptr &arg) : ptr(arg ? arg->clone() : 0) {}
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
polymorphic_ptr(polymorphic_ptr &&arg) : ptr(arg.take()) {}
|
polymorphic_ptr(polymorphic_ptr &&arg) : ptr(arg.take()) {}
|
||||||
#endif
|
|
||||||
~polymorphic_ptr() { delete ptr; }
|
~polymorphic_ptr() { delete ptr; }
|
||||||
|
|
||||||
polymorphic_ptr &operator=(polymorphic_ptr arg) {
|
polymorphic_ptr &operator=(polymorphic_ptr arg) {
|
||||||
|
@@ -98,13 +98,9 @@
|
|||||||
# define LLVM_HAS_VARIADIC_TEMPLATES 0
|
# define LLVM_HAS_VARIADIC_TEMPLATES 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// llvm_move - Expands to ::std::move if the compiler supports
|
/// llvm_move - Expands to ::std::move. This is a hold-over from when we did
|
||||||
/// r-value references; otherwise, expands to the argument.
|
/// not support R-value references.
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
#define llvm_move(value) (::std::move(value))
|
#define llvm_move(value) (::std::move(value))
|
||||||
#else
|
|
||||||
#define llvm_move(value) (value)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// Expands to '&' if r-value references are supported.
|
/// Expands to '&' if r-value references are supported.
|
||||||
///
|
///
|
||||||
|
@@ -42,13 +42,8 @@ namespace llvm {
|
|||||||
class ConstantRange {
|
class ConstantRange {
|
||||||
APInt Lower, Upper;
|
APInt Lower, Upper;
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
// If we have move semantics, pass APInts by value and move them into place.
|
// If we have move semantics, pass APInts by value and move them into place.
|
||||||
typedef APInt APIntMoveTy;
|
typedef APInt APIntMoveTy;
|
||||||
#else
|
|
||||||
// Otherwise pass by const ref to save one copy.
|
|
||||||
typedef const APInt &APIntMoveTy;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Initialize a full (the default) or empty set for the specified bit width.
|
/// Initialize a full (the default) or empty set for the specified bit width.
|
||||||
|
@@ -26,7 +26,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
#if LLVM_HAS_CXX11_TYPETRAITS && LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
template<class T, class V>
|
template<class T, class V>
|
||||||
typename std::enable_if< std::is_constructible<T, V>::value
|
typename std::enable_if< std::is_constructible<T, V>::value
|
||||||
, typename std::remove_reference<V>::type>::type &&
|
, typename std::remove_reference<V>::type>::type &&
|
||||||
@@ -40,12 +39,6 @@ typename std::enable_if< !std::is_constructible<T, V>::value
|
|||||||
moveIfMoveConstructible(V &Val) {
|
moveIfMoveConstructible(V &Val) {
|
||||||
return Val;
|
return Val;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
template<class T, class V>
|
|
||||||
V &moveIfMoveConstructible(V &Val) {
|
|
||||||
return Val;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// \brief Stores a reference that can be changed.
|
/// \brief Stores a reference that can be changed.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@@ -143,7 +136,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
ErrorOr(ErrorOr &&Other) {
|
ErrorOr(ErrorOr &&Other) {
|
||||||
moveConstruct(std::move(Other));
|
moveConstruct(std::move(Other));
|
||||||
}
|
}
|
||||||
@@ -163,7 +155,6 @@ public:
|
|||||||
moveAssign(std::move(Other));
|
moveAssign(std::move(Other));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
~ErrorOr() {
|
~ErrorOr() {
|
||||||
if (!HasError)
|
if (!HasError)
|
||||||
@@ -223,7 +214,6 @@ private:
|
|||||||
new (this) ErrorOr(Other);
|
new (this) ErrorOr(Other);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
template <class OtherT>
|
template <class OtherT>
|
||||||
void moveConstruct(ErrorOr<OtherT> &&Other) {
|
void moveConstruct(ErrorOr<OtherT> &&Other) {
|
||||||
if (!Other.HasError) {
|
if (!Other.HasError) {
|
||||||
@@ -245,7 +235,6 @@ private:
|
|||||||
this->~ErrorOr();
|
this->~ErrorOr();
|
||||||
new (this) ErrorOr(std::move(Other));
|
new (this) ErrorOr(std::move(Other));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
pointer toPointer(pointer Val) {
|
pointer toPointer(pointer Val) {
|
||||||
return Val;
|
return Val;
|
||||||
|
@@ -664,10 +664,8 @@ private:
|
|||||||
public:
|
public:
|
||||||
typedef char char_type;
|
typedef char char_type;
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
mapped_file_region(mapped_file_region&&);
|
mapped_file_region(mapped_file_region&&);
|
||||||
mapped_file_region &operator =(mapped_file_region&&);
|
mapped_file_region &operator =(mapped_file_region&&);
|
||||||
#endif
|
|
||||||
|
|
||||||
/// Construct a mapped_file_region at \a path starting at \a offset of length
|
/// Construct a mapped_file_region at \a path starting at \a offset of length
|
||||||
/// \a length and with access \a mode.
|
/// \a length and with access \a mode.
|
||||||
|
@@ -52,13 +52,11 @@ namespace llvm {
|
|||||||
std::swap(error, regex.error);
|
std::swap(error, regex.error);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
Regex(Regex &®ex) {
|
Regex(Regex &®ex) {
|
||||||
preg = regex.preg;
|
preg = regex.preg;
|
||||||
error = regex.error;
|
error = regex.error;
|
||||||
regex.preg = NULL;
|
regex.preg = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
~Regex();
|
~Regex();
|
||||||
|
|
||||||
/// isValid - returns the error encountered during regex compilation, or
|
/// isValid - returns the error encountered during regex compilation, or
|
||||||
|
@@ -186,7 +186,6 @@ SmallPtrSetImplBase::SmallPtrSetImplBase(const void **SmallStorage,
|
|||||||
NumTombstones = that.NumTombstones;
|
NumTombstones = that.NumTombstones;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
SmallPtrSetImplBase::SmallPtrSetImplBase(const void **SmallStorage,
|
SmallPtrSetImplBase::SmallPtrSetImplBase(const void **SmallStorage,
|
||||||
unsigned SmallSize,
|
unsigned SmallSize,
|
||||||
SmallPtrSetImplBase &&that) {
|
SmallPtrSetImplBase &&that) {
|
||||||
@@ -214,7 +213,6 @@ SmallPtrSetImplBase::SmallPtrSetImplBase(const void **SmallStorage,
|
|||||||
that.NumElements = 0;
|
that.NumElements = 0;
|
||||||
that.NumTombstones = 0;
|
that.NumTombstones = 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/// CopyFrom - implement operator= from a smallptrset that has the same pointer
|
/// CopyFrom - implement operator= from a smallptrset that has the same pointer
|
||||||
/// type, but may have a different small size.
|
/// type, but may have a different small size.
|
||||||
@@ -254,7 +252,6 @@ void SmallPtrSetImplBase::CopyFrom(const SmallPtrSetImplBase &RHS) {
|
|||||||
NumTombstones = RHS.NumTombstones;
|
NumTombstones = RHS.NumTombstones;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
void SmallPtrSetImplBase::MoveFrom(unsigned SmallSize,
|
void SmallPtrSetImplBase::MoveFrom(unsigned SmallSize,
|
||||||
SmallPtrSetImplBase &&RHS) {
|
SmallPtrSetImplBase &&RHS) {
|
||||||
assert(&RHS != this && "Self-move should be handled by the caller.");
|
assert(&RHS != this && "Self-move should be handled by the caller.");
|
||||||
@@ -282,7 +279,6 @@ void SmallPtrSetImplBase::MoveFrom(unsigned SmallSize,
|
|||||||
RHS.NumElements = 0;
|
RHS.NumElements = 0;
|
||||||
RHS.NumTombstones = 0;
|
RHS.NumTombstones = 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void SmallPtrSetImplBase::swap(SmallPtrSetImplBase &RHS) {
|
void SmallPtrSetImplBase::swap(SmallPtrSetImplBase &RHS) {
|
||||||
if (this == &RHS) return;
|
if (this == &RHS) return;
|
||||||
|
@@ -538,12 +538,10 @@ mapped_file_region::~mapped_file_region() {
|
|||||||
::munmap(Mapping, Size);
|
::munmap(Mapping, Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
mapped_file_region::mapped_file_region(mapped_file_region &&other)
|
mapped_file_region::mapped_file_region(mapped_file_region &&other)
|
||||||
: Mode(other.Mode), Size(other.Size), Mapping(other.Mapping) {
|
: Mode(other.Mode), Size(other.Size), Mapping(other.Mapping) {
|
||||||
other.Mapping = 0;
|
other.Mapping = 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
mapped_file_region::mapmode mapped_file_region::flags() const {
|
mapped_file_region::mapmode mapped_file_region::flags() const {
|
||||||
assert(Mapping && "Mapping failed but used anyway!");
|
assert(Mapping && "Mapping failed but used anyway!");
|
||||||
|
@@ -659,7 +659,6 @@ mapped_file_region::~mapped_file_region() {
|
|||||||
::UnmapViewOfFile(Mapping);
|
::UnmapViewOfFile(Mapping);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_HAS_RVALUE_REFERENCES
|
|
||||||
mapped_file_region::mapped_file_region(mapped_file_region &&other)
|
mapped_file_region::mapped_file_region(mapped_file_region &&other)
|
||||||
: Mode(other.Mode)
|
: Mode(other.Mode)
|
||||||
, Size(other.Size)
|
, Size(other.Size)
|
||||||
@@ -671,7 +670,6 @@ mapped_file_region::mapped_file_region(mapped_file_region &&other)
|
|||||||
other.FileHandle = INVALID_HANDLE_VALUE;
|
other.FileHandle = INVALID_HANDLE_VALUE;
|
||||||
other.FileDescriptor = 0;
|
other.FileDescriptor = 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
mapped_file_region::mapmode mapped_file_region::flags() const {
|
mapped_file_region::mapmode mapped_file_region::flags() const {
|
||||||
assert(Mapping && "Mapping failed but used anyway!");
|
assert(Mapping && "Mapping failed but used anyway!");
|
||||||
|
Reference in New Issue
Block a user