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 /include | |
parent | 21c276d2fa99914d5ed958ac0aec7d78e3dd87cf (diff) | |
download | external_llvm-3b5b4cd1a50e3fe8748a8626cca3c643f5681f5a.zip external_llvm-3b5b4cd1a50e3fe8748a8626cca3c643f5681f5a.tar.gz external_llvm-3b5b4cd1a50e3fe8748a8626cca3c643f5681f5a.tar.bz2 |
Add getABITypeSize, getABITypeSizeInBits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/TargetData.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h index f2e55f1..026749f 100644 --- a/include/llvm/Target/TargetData.h +++ b/include/llvm/Target/TargetData.h @@ -159,10 +159,23 @@ public: /// type. uint64_t getTypeSize(const Type *Ty) const; + /// getABITypeSize - Return the number of bytes allocated for the specified + /// type when used as an element in a larger object, including alignment + /// padding. + uint64_t getABITypeSize(const Type *Ty) const { + unsigned char Align = getABITypeAlignment(Ty); + return (getTypeSize(Ty) + Align - 1)/Align*Align; + } + /// getTypeSizeInBits - Return the number of bits necessary to hold the /// specified type. uint64_t getTypeSizeInBits(const Type* Ty) const; + /// getABITypeSizeInBits - Return the number of bytes allocated for the + /// specified type when used as an element in a larger object, including + /// alignment padding. + uint64_t getABITypeSizeInBits(const Type* Ty) const; + /// getABITypeAlignment - Return the minimum ABI-required alignment for the /// specified type. unsigned char getABITypeAlignment(const Type *Ty) const; |