aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Argument.h3
-rw-r--r--lib/VMCore/Function.cpp6
2 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Argument.h b/include/llvm/Argument.h
index 71c001fbe1..ff8637881e 100644
--- a/include/llvm/Argument.h
+++ b/include/llvm/Argument.h
@@ -51,6 +51,9 @@ public:
/// hasByValAttr - Return true if this argument has the byval attribute on it
/// in its containing function.
bool hasByValAttr() const;
+
+ /// getParamAlignment - If this is a byval argument, return its alignment.
+ unsigned getParamAlignment() const;
/// hasNestAttr - Return true if this argument has the nest attribute on
/// it in its containing function.
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index ce2186f5cd..0ae0bdb805 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 {