summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-25 23:18:11 +0000
committerChris Lattner <sabre@nondot.org>2010-01-25 23:18:11 +0000
commit3072add73c9cf88661b13e1b9ef03612f3eaf7ec (patch)
tree390ff38abbc0b6171e2d9759b1960d7d5fe2f6c6 /llvm/lib/Target
parent7af03fb4f0b9ab3856d71aaf87274d32c302686a (diff)
downloadbcm5719-llvm-3072add73c9cf88661b13e1b9ef03612f3eaf7ec.tar.gz
bcm5719-llvm-3072add73c9cf88661b13e1b9ef03612f3eaf7ec.zip
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. llvm-svn: 94468
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/TargetData.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp
index ba3cc9d9462..295b30fc36a 100644
--- a/llvm/lib/Target/TargetData.cpp
+++ b/llvm/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)
OpenPOWER on IntegriCloud