[cfe-commits] r43593 - /cfe/trunk/CodeGen/CodeGenModule.cpp

Anders Carlsson andersca at mac.com
Wed Oct 31 17:41:52 PDT 2007


Author: andersca
Date: Wed Oct 31 19:41:52 2007
New Revision: 43593

URL: http://llvm.org/viewvc/llvm-project?rev=43593&view=rev
Log:
Put constant CFStrings in the __DATA,__cfstring section.

Modified:
    cfe/trunk/CodeGen/CodeGenModule.cpp

Modified: cfe/trunk/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenModule.cpp?rev=43593&r1=43592&r2=43593&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenModule.cpp Wed Oct 31 19:41:52 2007
@@ -247,10 +247,11 @@
   // 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;
 }





More information about the cfe-commits mailing list