diff options
author | Chris Lattner <sabre@nondot.org> | 2011-05-22 23:57:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-05-22 23:57:23 +0000 |
commit | 4d37d9979857744d6bf306e8d90abb07209fea49 (patch) | |
tree | 127397e444e0d49be605c79ddaa3fe6dbae872eb /llvm/lib/VMCore/Function.cpp | |
parent | 6804685c43fb0ba1c571ee24515bfad0c005758f (diff) | |
download | bcm5719-llvm-4d37d9979857744d6bf306e8d90abb07209fea49.tar.gz bcm5719-llvm-4d37d9979857744d6bf306e8d90abb07209fea49.zip |
add a helper method to get the byval alignment of an argument.
llvm-svn: 131883
Diffstat (limited to 'llvm/lib/VMCore/Function.cpp')
-rw-r--r-- | llvm/lib/VMCore/Function.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp index ce2186f5cd0..0ae0bdb8056 100644 --- a/llvm/lib/VMCore/Function.cpp +++ b/llvm/lib/VMCore/Function.cpp @@ -79,6 +79,12 @@ bool Argument::hasByValAttr() const { return getParent()->paramHasAttr(getArgNo()+1, Attribute::ByVal); } +unsigned Argument::getParamAlignment() const { + assert(getType()->isPointerTy() && "Only pointers have alignments"); + return getParent()->getParamAlignment(getArgNo()+1); + +} + /// hasNestAttr - Return true if this argument has the nest attribute on /// it in its containing function. bool Argument::hasNestAttr() const { |