Author: baldrick Date: Mon Jan 21 05:27:55 2008 New Revision: 46206 URL: http://llvm.org/viewvc/llvm-project?rev=46206&view=rev Log: Be consistent with other attribute methods, and check the callee also if it is known.
Modified: llvm/trunk/lib/VMCore/Instructions.cpp Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=46206&r1=46205&r2=46206&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Mon Jan 21 05:27:55 2008 @@ -406,7 +406,13 @@ /// @brief Determine if any call argument is an aggregate passed by value. bool CallInst::hasByValArgument() const { - return ParamAttrs && ParamAttrs->hasAttrSomewhere(ParamAttr::ByVal); + if (ParamAttrs && ParamAttrs->hasAttrSomewhere(ParamAttr::ByVal)) + return true; + // Be consistent with other methods and check the callee too. + if (const Function *F = getCalledFunction()) + if (const ParamAttrsList *PAL = F->getParamAttrs()) + return PAL->hasAttrSomewhere(ParamAttr::ByVal); + return false; } void CallInst::setDoesNotThrow(bool doesNotThrow) { _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits