[llvm-commits] [dragonegg] r147852 - /dragonegg/trunk/src/Types.cpp

Duncan Sands baldrick at free.fr
Tue Jan 10 06:59:09 PST 2012


Author: baldrick
Date: Tue Jan 10 08:59:09 2012
New Revision: 147852

URL: http://llvm.org/viewvc/llvm-project?rev=147852&view=rev
Log:
Revert the previous commit with a note about what is going wrong
(i.e. exposed an issue somewhere else).

Modified:
    dragonegg/trunk/src/Types.cpp

Modified: dragonegg/trunk/src/Types.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Types.cpp?rev=147852&r1=147851&r2=147852&view=diff
==============================================================================
--- dragonegg/trunk/src/Types.cpp (original)
+++ dragonegg/trunk/src/Types.cpp Tue Jan 10 08:59:09 2012
@@ -497,7 +497,11 @@
   Type *Ty = ArrayType::get(ElementTy, NumElements);
 
   // If the array is underaligned, wrap it in a packed struct.
-  if (TYPE_ALIGN(type) < TYPE_ALIGN(TREE_TYPE(type)))
+  if (TYPE_ALIGN(type) < getTargetData().getABITypeAlignment(Ty) * 8)
+// FIXME: Should use the following in case the LLVM type has no size, but this
+// breaks bootstrap due to an array with a 32 bit element type that is only 8
+// bit aligned.
+//  if (TYPE_ALIGN(type) < TYPE_ALIGN(TREE_TYPE(type)))
     Ty = StructType::get(Context, Ty, /*isPacked*/ true);
 
   // If the user increased the alignment of the array element type, then the





More information about the llvm-commits mailing list