[llvm-commits] CVS: llvm/lib/Target/TargetData.cpp

Evan Cheng evan.cheng at apple.com
Fri Mar 31 14:33:54 PST 2006



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: {






More information about the llvm-commits mailing list