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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user