[llvm-commits] [dragonegg] r147857 - /dragonegg/trunk/src/Types.cpp
Duncan Sands
baldrick at free.fr
Tue Jan 10 09:45:34 PST 2012
Author: baldrick
Date: Tue Jan 10 11:45:34 2012
New Revision: 147857
URL: http://llvm.org/viewvc/llvm-project?rev=147857&view=rev
Log:
Reapply 147850 with a fix: look at the main variant, like
ConvertType does.
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=147857&r1=147856&r2=147857&view=diff
==============================================================================
--- dragonegg/trunk/src/Types.cpp (original)
+++ dragonegg/trunk/src/Types.cpp Tue Jan 10 11:45:34 2012
@@ -497,11 +497,7 @@
Type *Ty = ArrayType::get(ElementTy, NumElements);
// If the array is underaligned, wrap it in a packed struct.
- 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)))
+ if (TYPE_ALIGN(type) < TYPE_ALIGN(TYPE_MAIN_VARIANT(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