Put constant CFStrings in the __DATA,__cfstring section.

llvm-svn: 43593
This commit is contained in:
Anders Carlsson 2007-11-01 00:41:52 +00:00
parent 1e27f9b296
commit 41b7c6b250
1 changed files with 7 additions and 6 deletions

View File

@ -247,10 +247,11 @@ GetAddrOfConstantCFString(const std::string &str) {
// The struct.
Ty = getTypes().ConvertType(getContext().getCFConstantStringType());
C = llvm::ConstantStruct::get(cast<llvm::StructType>(Ty), Fields);
C = new llvm::GlobalVariable(C->getType(), true,
llvm::GlobalVariable::InternalLinkage,
C, "", &getModule());
Entry.setValue(C);
return C;
llvm::GlobalVariable *GV =
new llvm::GlobalVariable(C->getType(), true,
llvm::GlobalVariable::InternalLinkage,
C, "", &getModule());
GV->setSection("__DATA,__cfstring");
Entry.setValue(GV);
return GV;
}