diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-23 18:17:34 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-23 18:17:34 +0000 |
commit | 6316fbcb04af00fe76b6526fab09f51484014b3e (patch) | |
tree | 8b18f95c06e96a5e23713880efa491c02372f40c /lib/VMCore/LLVMContextImpl.cpp | |
parent | b53cc014d0f47b898c9daca34566c16dda6c4c1e (diff) |
Convert StringMap to using StringRef for its APIs.
- Yay for '-'s and simplifications!
- I kept StringMap::GetOrCreateValue for compatibility purposes, this can
eventually go away. Likewise the StringMapEntry Create functions still follow
the old style.
- NIFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76888 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/LLVMContextImpl.cpp')
-rw-r--r-- | lib/VMCore/LLVMContextImpl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/VMCore/LLVMContextImpl.cpp b/lib/VMCore/LLVMContextImpl.cpp index 79b33c1458..1c5af77c1c 100644 --- a/lib/VMCore/LLVMContextImpl.cpp +++ b/lib/VMCore/LLVMContextImpl.cpp @@ -397,7 +397,7 @@ MDString *LLVMContextImpl::getMDString(const char *StrBegin, unsigned StrLength) { sys::SmartScopedWriter<true> Writer(ConstantsLock); StringMapEntry<MDString *> &Entry = - MDStringCache.GetOrCreateValue(StrBegin, StrBegin + StrLength); + MDStringCache.GetOrCreateValue(StringRef(StrBegin, StrLength)); MDString *&S = Entry.getValue(); if (!S) S = new MDString(Entry.getKeyData(), Entry.getKeyLength()); @@ -460,8 +460,8 @@ Constant *LLVMContextImpl::getConstantArray(const ArrayType *Ty, void LLVMContextImpl::erase(MDString *M) { sys::SmartScopedWriter<true> Writer(ConstantsLock); - MDStringCache.erase(MDStringCache.find(M->StrBegin, - M->StrBegin + M->length())); + MDStringCache.erase(MDStringCache.find(StringRef(M->StrBegin, + M->length()))); } void LLVMContextImpl::erase(MDNode *M) { |