diff options
author | Dale Johannesen <dalej@apple.com> | 2007-10-01 16:03:14 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2007-10-01 16:03:14 +0000 |
commit | 3b5b4cd1a50e3fe8748a8626cca3c643f5681f5a (patch) | |
tree | e72511b48ddf02462b3ccbdecb5b75fa602fdbc9 /lib/Target/TargetData.cpp | |
parent | 21c276d2fa99914d5ed958ac0aec7d78e3dd87cf (diff) |
Add getABITypeSize, getABITypeSizeInBits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetData.cpp')
-rw-r--r-- | lib/Target/TargetData.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index 30284263ae..0bdb23b5b7 100644 --- a/lib/Target/TargetData.cpp +++ b/lib/Target/TargetData.cpp @@ -471,7 +471,12 @@ uint64_t TargetData::getTypeSizeInBits(const Type *Ty) const { return getTypeSize(Ty) * 8; } - +uint64_t TargetData::getABITypeSizeInBits(const Type *Ty) const { + if (Ty->isInteger()) + return cast<IntegerType>(Ty)->getBitWidth(); + else + return getABITypeSize(Ty) * 8; +} /*! \param abi_or_pref Flag that determines which alignment is returned. true returns the ABI alignment, false returns the preferred alignment. |