[llvm-branch-commits] [llvm-gcc-branch] r89431 - in /llvm-gcc-4.2/branches/Apple/Zoidberg/gcc: config/darwin.h llvm-backend.cpp

Bill Wendling isanbard at gmail.com
Thu Nov 19 17:21:28 PST 2009


Author: void
Date: Thu Nov 19 19:21:27 2009
New Revision: 89431

URL: http://llvm.org/viewvc/llvm-project?rev=89431&view=rev
Log:
$ svn merge -c 89415 https://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk
--- Merging r89415 into '.':
U    gcc/llvm-backend.cpp
U    gcc/config/darwin.h


Modified:
    llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/config/darwin.h
    llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-backend.cpp

Modified: llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/config/darwin.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/config/darwin.h?rev=89431&r1=89430&r2=89431&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/config/darwin.h (original)
+++ llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/config/darwin.h Thu Nov 19 19:21:27 2009
@@ -698,10 +698,21 @@
       char *N = (char *)alloca(strlen(fmt) + 37);                       \
       sprintf(N, fmt, i++);                                             \
       GV->setName(N);                                                   \
+      GV->setAlignment(TARGET_64BIT ? 8 : 4);                           \
     }                                                                   \
   } while (0)
 /* LLVM LOCAL - end radar 6389998 */
 
+/* LLVM LOCAL - begin radar 7291825 */
+/* Give a constant string a sufficient alignment for the platform.  */
+#define TARGET_ADJUST_CSTRING_ALIGN(GV)                                 \
+  do {                                                                  \
+    if (GV->hasInternalLinkage()) {                                     \
+      GV->setAlignment(TARGET_64BIT ? 8 : 4);                           \
+    }                                                                   \
+  } while (0)
+/* LLVM LOCAL - end radar 7291825 */
+
 #endif
 /* LLVM LOCAL end */
 

Modified: llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-backend.cpp?rev=89431&r1=89430&r2=89431&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-backend.cpp Thu Nov 19 19:21:27 2009
@@ -1408,8 +1408,16 @@
       unsigned TargetAlign =
         getTargetData().getABITypeAlignment(GV->getType()->getElementType());
       if (DECL_USER_ALIGN(decl) ||
-          8 * TargetAlign < (unsigned)DECL_ALIGN(decl))
+          8 * TargetAlign < (unsigned)DECL_ALIGN(decl)) {
         GV->setAlignment(DECL_ALIGN(decl) / 8);
+      }
+#ifdef TARGET_ADJUST_CSTRING_ALIGN
+      else if (DECL_INITIAL(decl) != error_mark_node && // uninitialized?
+               DECL_INITIAL(decl) &&
+               TREE_CODE(DECL_INITIAL(decl)) == STRING_CST) {
+        TARGET_ADJUST_CSTRING_ALIGN(GV);
+      }
+#endif
     }
 
     // Handle used decls





More information about the llvm-branch-commits mailing list