[cfe-commits] r76885 - /cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Daniel Dunbar
daniel at zuster.org
Thu Jul 23 10:33:52 PDT 2009
Author: ddunbar
Date: Thu Jul 23 12:33:49 2009
New Revision: 76885
URL: http://llvm.org/viewvc/llvm-project?rev=76885&view=rev
Log:
Simplify.
Modified:
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=76885&r1=76884&r2=76885&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Thu Jul 23 12:33:49 2009
@@ -1226,11 +1226,10 @@
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 @@
"_unnamed_cfstring_");
if (const char *Sect = getContext().Target.getCFStringSection())
GV->setSection(Sect);
- Entry.setValue(GV);
+ Entry = GV;
return GV;
}
More information about the cfe-commits
mailing list