[llvm-commits] [llvm-gcc-4.2] r65490 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Stuart Hastings stuart at apple.com
Wed Feb 25 16:05:28 PST 2009


Author: stuart
Date: Wed Feb 25 18:05:28 2009
New Revision: 65490

URL: http://llvm.org/viewvc/llvm-project?rev=65490&view=rev
Log:
Put all normal (no embedded NUL characters), constant STRING_CSTs in
the .cstring section.

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=65490&r1=65489&r2=65490&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Wed Feb 25 18:05:28 2009
@@ -7181,6 +7181,9 @@
                                             TAI->getStringConstantPrefix() : 
                                             ".str", TheModule);
   if (SlotP) *SlotP = GV;
+  // Try to put it into the .cstring (__TEXT, __cstring) section.
+  if (StringIsConstant && static_cast<ConstantArray*>(Init)->isCString())
+    GV->setSection("__TEXT, __cstring");
   return GV;
 }
 





More information about the llvm-commits mailing list