Make constant emission for @encode use the common string emission code.

This is a bit cleaner, and also "fixes" bad code that compares the 
addresses of the string constants.

llvm-svn: 66346
This commit is contained in:
Eli Friedman
2009-03-07 20:17:55 +00:00
parent 03676f557c
commit 4663a3368d
2 changed files with 7 additions and 6 deletions

View File

@@ -1132,12 +1132,8 @@ llvm::Constant *
CodeGenModule::GetAddrOfConstantStringFromObjCEncode(const ObjCEncodeExpr *E) {
std::string Str;
getContext().getObjCEncodingForType(E->getEncodedType(), Str);
llvm::Constant *C = llvm::ConstantArray::get(Str);
C = new llvm::GlobalVariable(C->getType(), true,
llvm::GlobalValue::InternalLinkage,
C, ".str", &getModule());
return C;
return GetAddrOfConstantCString(Str);
}