From: Daniel Dunbar Date: Thu, 23 Jul 2009 17:33:49 +0000 (+0000) Subject: Simplify. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=635d481de0fd17c6ac76c22adfa826c0e1d60cf6;p=platform%2Fupstream%2Fllvm.git Simplify. llvm-svn: 76885 --- diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 20fbbd2..4321765 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1226,11 +1226,10 @@ GetAddrOfConstantCFString(const StringLiteral *Literal) { str.assign(Literal->getStrData(), Literal->getByteLength()); StringLength = str.length(); } - llvm::StringMapEntry &Entry = - CFConstantStringMap.GetOrCreateValue(&str[0], &str[str.length()]); + llvm::Constant *&Entry = CFConstantStringMap[str]; - if (llvm::Constant *C = Entry.getValue()) - return C; + if (Entry) + return Entry; llvm::Constant *Zero = getLLVMContext().getNullValue(llvm::Type::Int32Ty); llvm::Constant *Zeros[] = { Zero, Zero }; @@ -1320,7 +1319,7 @@ GetAddrOfConstantCFString(const StringLiteral *Literal) { "_unnamed_cfstring_"); if (const char *Sect = getContext().Target.getCFStringSection()) GV->setSection(Sect); - Entry.setValue(GV); + Entry = GV; return GV; }