Changes in directory llvm/lib/Target:

TargetData.cpp updated: 1.58 -> 1.59
---
Log message:

TargetData.cpp::getTypeInfo() was returning alignment of element type as the
alignment of a packed type. This is obviously wrong. Added a workaround that
returns the size of the packed type as its alignment. The correct fix would
be to return a target dependent alignment value provided via TargetLowering
(or some other interface).


---
Diffs of the changes:  (+3 -0)

 TargetData.cpp |    3 +++
 1 files changed, 3 insertions(+)


Index: llvm/lib/Target/TargetData.cpp
diff -u llvm/lib/Target/TargetData.cpp:1.58 llvm/lib/Target/TargetData.cpp:1.59
--- llvm/lib/Target/TargetData.cpp:1.58 Fri Jan 13 18:07:34 2006
+++ llvm/lib/Target/TargetData.cpp      Fri Mar 31 16:33:42 2006
@@ -215,6 +215,9 @@
     getTypeInfo(PTy->getElementType(), TD, Size, Alignment);
     unsigned AlignedSize = (Size + Alignment - 1)/Alignment*Alignment;
     Size = AlignedSize*PTy->getNumElements();
+    // FIXME: The alignments of specific packed types are target dependent.
+    // For now, just set it to be equal to Size.
+    Alignment = Size;
     return;
   }
   case Type::StructTyID: {



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to