aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Function.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-02-18 04:06:26 +0000
committerOwen Anderson <resistor@mac.com>2008-02-18 04:06:26 +0000
commit9eb948b46623977cd4de7d4156b3c3058a7ebed3 (patch)
treed4ad01a7ed524e74203117862949180750420171 /lib/VMCore/Function.cpp
parentae708a3d91a9babfa171760f15d0fdcedd674d0d (diff)
Duncan pointed out that we can fast fail here, because the sret parameter of
a function must be the first parameter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47254 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r--lib/VMCore/Function.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index fe3f2fe770..e7a7041d77 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -107,7 +107,8 @@ bool Argument::hasNoAliasAttr() const {
/// it in its containing function.
bool Argument::hasStructRetAttr() const {
if (!isa<PointerType>(getType())) return false;
- return getParent()->paramHasAttr(getArgNo()+1, ParamAttr::StructRet);
+ if (getArgNo()) return false; // StructRet param must be first param
+ return getParent()->paramHasAttr(1, ParamAttr::StructRet);
}