diff options
author | Anders Carlsson <andersca@mac.com> | 2007-11-01 00:41:52 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2007-11-01 00:41:52 +0000 |
commit | 0c67829763b98bc670062b553897a851fab17401 (patch) | |
tree | 19f742168f218fb10c12a930bdf9a5371668e7f6 /CodeGen/CodeGenModule.cpp | |
parent | d6a275f9a27d1c91e4084398d04030719b5b8f18 (diff) |
Put constant CFStrings in the __DATA,__cfstring section.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43593 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenModule.cpp')
-rw-r--r-- | CodeGen/CodeGenModule.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/CodeGen/CodeGenModule.cpp b/CodeGen/CodeGenModule.cpp index a2023e441f..6faf3f88d7 100644 --- a/CodeGen/CodeGenModule.cpp +++ b/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; } |