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 | 5bf72e20eb49ddd2e977c860670a1e71dbfd89c0 (patch) | |
tree | 15bf09e9cdd6a22769ffcef383cab9c17b7013ca /llvm/lib/VMCore/LLVMContextImpl.cpp | |
parent | 07b749230c6d6bbc4194038cfd9313a7fa494fe1 (diff) | |
download | bcm5719-llvm-5bf72e20eb49ddd2e977c860670a1e71dbfd89c0.tar.gz bcm5719-llvm-5bf72e20eb49ddd2e977c860670a1e71dbfd89c0.zip |
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.
llvm-svn: 76888
Diffstat (limited to 'llvm/lib/VMCore/LLVMContextImpl.cpp')
-rw-r--r-- | llvm/lib/VMCore/LLVMContextImpl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/LLVMContextImpl.cpp b/llvm/lib/VMCore/LLVMContextImpl.cpp index 79b33c14581..1c5af77c1cb 100644 --- a/llvm/lib/VMCore/LLVMContextImpl.cpp +++ b/llvm/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) { |