diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2006-03-31 22:33:42 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2006-03-31 22:33:42 +0000 |
| commit | a11d834b8c287203f022352e219f784e90ba41ed (patch) | |
| tree | 6c52465888a3cf12c63c2cd0f34e52f5a496b0e6 /llvm/lib/Target/TargetData.cpp | |
| parent | 39dcf1a9e2d838ea0bcf9e639439e2ae338e2fe4 (diff) | |
| download | bcm5719-llvm-a11d834b8c287203f022352e219f784e90ba41ed.tar.gz bcm5719-llvm-a11d834b8c287203f022352e219f784e90ba41ed.zip | |
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).
llvm-svn: 27319
Diffstat (limited to 'llvm/lib/Target/TargetData.cpp')
| -rw-r--r-- | llvm/lib/Target/TargetData.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp index 40b762d8e73..63c5b6178a3 100644 --- a/llvm/lib/Target/TargetData.cpp +++ b/llvm/lib/Target/TargetData.cpp @@ -215,6 +215,9 @@ static inline void getTypeInfo(const Type *Ty, const TargetData *TD, 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: { |

