diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h index 8d4a19d0919..f7ae346253f 100644 --- a/include/llvm/ADT/DenseMap.h +++ b/include/llvm/ADT/DenseMap.h @@ -14,6 +14,7 @@ #ifndef LLVM_ADT_DENSEMAP_H #define LLVM_ADT_DENSEMAP_H +#include "llvm/Support/Compiler.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/PointerLikeTypeTraits.h" #include "llvm/Support/type_traits.h" @@ -438,8 +439,8 @@ private: bool FoundVal = LookupBucketFor(B->first, DestBucket); (void)FoundVal; // silence warning. assert(!FoundVal && "Key already in new map?"); - DestBucket->first = B->first; - new (&DestBucket->second) ValueT(B->second); + DestBucket->first = llvm_move(B->first); + new (&DestBucket->second) ValueT(llvm_move(B->second)); // Free the value. B->second.~ValueT(); diff --git a/include/llvm/ADT/TinyPtrVector.h b/include/llvm/ADT/TinyPtrVector.h index 5014517c9e0..f9b7d559c39 100644 --- a/include/llvm/ADT/TinyPtrVector.h +++ b/include/llvm/ADT/TinyPtrVector.h @@ -10,8 +10,10 @@ #ifndef LLVM_ADT_TINYPTRVECTOR_H #define LLVM_ADT_TINYPTRVECTOR_H +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/PointerUnion.h" +#include "llvm/Support/Compiler.h" namespace llvm { @@ -32,6 +34,11 @@ public: if (VecTy *V = Val.template dyn_cast()) Val = new VecTy(*V); } +#if LLVM_USE_RVALUE_REFERENCES + TinyPtrVector(TinyPtrVector &&RHS) : Val(RHS.Val) { + RHS.Val = (EltTy)0; + } +#endif ~TinyPtrVector() { if (VecTy *V = Val.template dyn_cast()) delete V; @@ -159,6 +166,9 @@ public: private: void operator=(const TinyPtrVector&); // NOT IMPLEMENTED YET. +#if LLVM_USE_RVALUE_REFERENCES + void operator=(TinyPtrVector&&); // NOT IMPLEMENTED YET. +#endif }; } // end namespace llvm