diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-23 17:33:49 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-23 17:33:49 +0000 |
commit | 2a3856ac8a52ed84349e830253c5dac616858f5c (patch) | |
tree | 316227a6e314aced2efd65fb430bdeff54e602cc /lib/CodeGen/CodeGenModule.cpp | |
parent | 4b5584b38b860e8ecb20420e2fe16d5ed97a68a0 (diff) |
Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76885 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 20fbbd2f2e..4321765607 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1226,11 +1226,10 @@ GetAddrOfConstantCFString(const StringLiteral *Literal) { str.assign(Literal->getStrData(), Literal->getByteLength()); StringLength = str.length(); } - llvm::StringMapEntry<llvm::Constant *> &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; } |