[llvm-commits] [llvm] r47254 - /llvm/trunk/lib/VMCore/Function.cpp
Owen Anderson
resistor at mac.com
Sun Feb 17 20:06:27 PST 2008
Author: resistor
Date: Sun Feb 17 22:06:26 2008
New Revision: 47254
URL: http://llvm.org/viewvc/llvm-project?rev=47254&view=rev
Log:
Duncan pointed out that we can fast fail here, because the sret parameter of
a function must be the first parameter.
Modified:
llvm/trunk/lib/VMCore/Function.cpp
Modified: llvm/trunk/lib/VMCore/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=47254&r1=47253&r2=47254&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Function.cpp (original)
+++ llvm/trunk/lib/VMCore/Function.cpp Sun Feb 17 22:06:26 2008
@@ -107,7 +107,8 @@
/// 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);
}
More information about the llvm-commits
mailing list