Changes in directory llvm/lib/Target:
TargetData.cpp updated: 1.79 -> 1.80 --- Log message: Implement a getTypeSizeInBits method. This helps in transforms that want to ensure the bit size of a type is identical before proceeding. --- Diffs of the changes: (+10 -0) TargetData.cpp | 10 ++++++++++ 1 files changed, 10 insertions(+) Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.79 llvm/lib/Target/TargetData.cpp:1.80 --- llvm/lib/Target/TargetData.cpp:1.79 Sat Jan 20 17:07:13 2007 +++ llvm/lib/Target/TargetData.cpp Sat Jan 20 17:32:04 2007 @@ -426,6 +426,16 @@ return Size; } +uint64_t TargetData::getTypeSizeInBits(const Type *Ty) const { + if (Ty->isInteger()) + return cast<IntegerType>(Ty)->getBitWidth(); + + uint64_t Size; + unsigned char Align; + getTypeInfoABI(Ty, this, Size, Align); + return Size * 8; +} + unsigned char TargetData::getTypeAlignmentABI(const Type *Ty) const { uint64_t Size; unsigned char Align; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits