summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/StringMap.h
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-05-08 21:52:23 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-05-08 21:52:23 +0000
commitb0439e6d6a7c3cd93589b712b732334803506184 (patch)
tree9eed67e33426746babef177ef885b6a7da3fac71 /include/llvm/ADT/StringMap.h
parent24ac5dfba02400ce57907dc150a8023f7678a62d (diff)
downloadllvm-b0439e6d6a7c3cd93589b712b732334803506184.tar.gz
llvm-b0439e6d6a7c3cd93589b712b732334803506184.tar.bz2
llvm-b0439e6d6a7c3cd93589b712b732334803506184.tar.xz
StringMap support for move-only values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/StringMap.h')
-rw-r--r--include/llvm/ADT/StringMap.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h
index a966977ea5..3a0006f5a1 100644
--- a/include/llvm/ADT/StringMap.h
+++ b/include/llvm/ADT/StringMap.h
@@ -109,8 +109,8 @@ public:
explicit StringMapEntry(unsigned strLen)
: StringMapEntryBase(strLen), second() {}
- StringMapEntry(unsigned strLen, const ValueTy &V)
- : StringMapEntryBase(strLen), second(V) {}
+ StringMapEntry(unsigned strLen, ValueTy V)
+ : StringMapEntryBase(strLen), second(std::move(V)) {}
StringRef getKey() const {
return StringRef(getKeyData(), getKeyLength());
@@ -146,7 +146,7 @@ public:
static_cast<StringMapEntry*>(Allocator.Allocate(AllocSize,Alignment));
// Default construct the value.
- new (NewItem) StringMapEntry(KeyLength, InitVal);
+ new (NewItem) StringMapEntry(KeyLength, std::move(InitVal));
// Copy the string information.
char *StrBuffer = const_cast<char*>(NewItem->getKeyData());
@@ -166,7 +166,7 @@ public:
static StringMapEntry *Create(const char *KeyStart, const char *KeyEnd,
InitType InitVal) {
MallocAllocator A;
- return Create(KeyStart, KeyEnd, A, InitVal);
+ return Create(KeyStart, KeyEnd, A, std::move(InitVal));
}
static StringMapEntry *Create(const char *KeyStart, const char *KeyEnd) {
@@ -348,7 +348,7 @@ public:
return *static_cast<MapEntryTy*>(Bucket);
MapEntryTy *NewItem =
- MapEntryTy::Create(Key.begin(), Key.end(), Allocator, Val);
+ MapEntryTy::Create(Key.begin(), Key.end(), Allocator, std::move(Val));
if (Bucket == getTombstoneVal())
--NumTombstones;