summaryrefslogtreecommitdiffstats
path: root/clang/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2007-11-01 00:41:52 +0000
committerAnders Carlsson <andersca@mac.com>2007-11-01 00:41:52 +0000
commit41b7c6b250560d5015defaa5c112f355c2e91664 (patch)
tree5f3efa8de0c1b07e26775c4d6c2f5f057d9392b4 /clang/CodeGen/CodeGenModule.cpp
parent1e27f9b296d82b59e898124f1259c5de6d044842 (diff)
downloadbcm5719-llvm-41b7c6b250560d5015defaa5c112f355c2e91664.tar.gz
bcm5719-llvm-41b7c6b250560d5015defaa5c112f355c2e91664.zip
Put constant CFStrings in the __DATA,__cfstring section.
llvm-svn: 43593
Diffstat (limited to 'clang/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/CodeGen/CodeGenModule.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/CodeGen/CodeGenModule.cpp b/clang/CodeGen/CodeGenModule.cpp
index a2023e441ff..6faf3f88d75 100644
--- a/clang/CodeGen/CodeGenModule.cpp
+++ b/clang/CodeGen/CodeGenModule.cpp
@@ -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;
}
OpenPOWER on IntegriCloud