summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-23 17:33:49 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-23 17:33:49 +0000
commit635d481de0fd17c6ac76c22adfa826c0e1d60cf6 (patch)
tree8b6106f5bc32ef756e6d7020ba5b05b6e9bee8c2 /clang/lib/CodeGen/CodeGenModule.cpp
parentd78fc89fcbb7ff4526c0ad754641f26665da1de0 (diff)
downloadbcm5719-llvm-635d481de0fd17c6ac76c22adfa826c0e1d60cf6.tar.gz
bcm5719-llvm-635d481de0fd17c6ac76c22adfa826c0e1d60cf6.zip
Simplify.
llvm-svn: 76885
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 20fbbd2f2ee..43217656076 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<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;
}
OpenPOWER on IntegriCloud