From 6316fbcb04af00fe76b6526fab09f51484014b3e Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 23 Jul 2009 18:17:34 +0000 Subject: 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 --- lib/VMCore/LLVMContextImpl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/VMCore/LLVMContextImpl.cpp') diff --git a/lib/VMCore/LLVMContextImpl.cpp b/lib/VMCore/LLVMContextImpl.cpp index 79b33c1..1c5af77 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 Writer(ConstantsLock); StringMapEntry &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 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) { -- cgit v1.1