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

Bill Wendling isanbard at gmail.com
Wed Jun 3 13:49:35 PDT 2009


Author: void
Date: Wed Jun  3 15:49:35 2009
New Revision: 72804

URL: http://llvm.org/viewvc/llvm-project?rev=72804&view=rev
Log:
Set the alignment of STRING_CSTs to be that which GCC expects it to be. We were
setting it to a default that made the alignment much larger than it needed to
be and wasting space.

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=72804&r1=72803&r2=72804&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Wed Jun  3 15:49:35 2009
@@ -7418,6 +7418,10 @@
                                            TAI ? 
                                             TAI->getStringConstantPrefix() : 
                                             ".str", TheModule);
+
+  if (optimize_size)
+    GV->setAlignment(TYPE_ALIGN(TREE_TYPE(exp)) / 8);
+
   if (SlotP) *SlotP = GV;
 #ifdef LLVM_CSTRING_SECTION
   // For Darwin, try to put it into the .cstring section.





More information about the llvm-commits mailing list