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 | ae441cc33cee83a598f74e3d0447fe02157b0389 (patch) | |
tree | e4f784a55f91bf6380eac0f998a431b6ddb765a3 /lib/VMCore/Function.cpp | |
parent | 9db20f3bd89e51e0765ef21a9992f6dd5364a81e (diff) | |
download | external_llvm-ae441cc33cee83a598f74e3d0447fe02157b0389.zip external_llvm-ae441cc33cee83a598f74e3d0447fe02157b0389.tar.gz external_llvm-ae441cc33cee83a598f74e3d0447fe02157b0389.tar.bz2 |
add a helper method to get the byval alignment of an argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131883 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r-- | lib/VMCore/Function.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index ce2186f..0ae0bdb 100644 --- a/lib/VMCore/Function.cpp +++ b/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 { |