diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-25 23:18:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-25 23:18:11 +0000 |
commit | da63b3ad6307cb4094383fad9695e4bb32ccac01 (patch) | |
tree | f7a898c71535dd835ff4d8ea96478f97bfd95fda /lib/Target/TargetData.cpp | |
parent | aeb326aad70acd1dd8b08564be4165eabc9ef542 (diff) |
add a method to get the alignment of an integer type even
when we don't have one laying around. Useful if you don't
have an llvmcontext handy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94468 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetData.cpp')
-rw-r--r-- | lib/Target/TargetData.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index ba3cc9d946..295b30fc36 100644 --- a/lib/Target/TargetData.cpp +++ b/lib/Target/TargetData.cpp @@ -545,6 +545,13 @@ unsigned char TargetData::getABITypeAlignment(const Type *Ty) const { return getAlignment(Ty, true); } +/// getABIIntegerTypeAlignment - Return the minimum ABI-required alignment for +/// an integer type of the specified bitwidth. +unsigned char TargetData::getABIIntegerTypeAlignment(unsigned BitWidth) const { + return getAlignmentInfo(INTEGER_ALIGN, BitWidth, true, 0); +} + + unsigned char TargetData::getCallFrameTypeAlignment(const Type *Ty) const { for (unsigned i = 0, e = Alignments.size(); i != e; ++i) if (Alignments[i].AlignType == STACK_ALIGN) |