X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=include%2Fllvm%2FADT%2FSmallVector.h;h=2a5168c261fb4b96b8b8e4dfa4a9838deeb35294;hb=e56ffb951f76424cd6e9cc795bfc3b2e8033798f;hp=505aa8d8ae6184f09f4a0b36a5324d3946850f44;hpb=ef6cf471125156a14a7f58f85fe487e59b0d130b;p=android-x86%2Fexternal-llvm.git diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index 505aa8d8ae6..2a5168c261f 100644 --- a/include/llvm/ADT/SmallVector.h +++ b/include/llvm/ADT/SmallVector.h @@ -183,13 +183,9 @@ protected: /// std::move, but not all stdlibs actually provide that. template static It2 move(It1 I, It1 E, It2 Dest) { -#if LLVM_HAS_RVALUE_REFERENCES for (; I != E; ++I, ++Dest) *Dest = ::std::move(*I); return Dest; -#else - return ::std::copy(I, E, Dest); -#endif } /// move_backward - Use move-assignment to move the range @@ -198,25 +194,17 @@ protected: /// std::move_backward, but not all stdlibs actually provide that. template static It2 move_backward(It1 I, It1 E, It2 Dest) { -#if LLVM_HAS_RVALUE_REFERENCES while (I != E) *--Dest = ::std::move(*--E); return Dest; -#else - return ::std::copy_backward(I, E, Dest); -#endif } /// uninitialized_move - Move the range [I, E) into the uninitialized /// memory starting with "Dest", constructing elements as needed. template static void uninitialized_move(It1 I, It1 E, It2 Dest) { -#if LLVM_HAS_RVALUE_REFERENCES for (; I != E; ++I, ++Dest) ::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 @@ -244,7 +232,6 @@ public: goto Retry; } -#if LLVM_HAS_RVALUE_REFERENCES void push_back(T &&Elt) { if (this->EndX < this->CapacityX) { Retry: @@ -255,8 +242,7 @@ public: this->grow(); goto Retry; } -#endif - + void pop_back() { this->setEnd(this->end()-1); this->end()->~T(); @@ -428,11 +414,7 @@ public: } T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() { -#if LLVM_HAS_RVALUE_REFERENCES T Result = ::std::move(this->back()); -#else - T Result = this->back(); -#endif this->pop_back(); return Result; } @@ -501,7 +483,6 @@ public: return(N); } -#if LLVM_HAS_RVALUE_REFERENCES iterator insert(iterator I, T &&Elt) { if (I == this->end()) { // Important special case for empty vector. this->push_back(::std::move(Elt)); @@ -532,7 +513,6 @@ public: I = this->begin()+EltNo; goto Retry; } -#endif iterator insert(iterator I, const T &Elt) { if (I == this->end()) { // Important special case for empty vector. @@ -673,9 +653,7 @@ public: SmallVectorImpl &operator=(const SmallVectorImpl &RHS); -#if LLVM_HAS_RVALUE_REFERENCES SmallVectorImpl &operator=(SmallVectorImpl &&RHS); -#endif bool operator==(const SmallVectorImpl &RHS) const { if (this->size() != RHS.size()) return false; @@ -793,7 +771,6 @@ SmallVectorImpl &SmallVectorImpl:: return *this; } -#if LLVM_HAS_RVALUE_REFERENCES template SmallVectorImpl &SmallVectorImpl::operator=(SmallVectorImpl &&RHS) { // Avoid self-assignment. @@ -855,7 +832,6 @@ SmallVectorImpl &SmallVectorImpl::operator=(SmallVectorImpl &&RHS) { RHS.clear(); return *this; } -#endif /// Storage for the SmallVector elements which aren't contained in /// SmallVectorTemplateCommon. There are 'N-1' elements here. The remaining '1' @@ -904,7 +880,6 @@ public: return *this; } -#if LLVM_HAS_RVALUE_REFERENCES SmallVector(SmallVector &&RHS) : SmallVectorImpl(N) { if (!RHS.empty()) SmallVectorImpl::operator=(::std::move(RHS)); @@ -914,8 +889,6 @@ public: SmallVectorImpl::operator=(::std::move(RHS)); return *this; } -#endif - }; template