Be consistent with other attribute methods, and

check the callee also if it is known.

llvm-svn: 46206
This commit is contained in:
Duncan Sands 2008-01-21 11:27:55 +00:00
parent 59e0e4bf35
commit a59f396cba
1 changed files with 7 additions and 1 deletions

View File

@ -406,7 +406,13 @@ bool CallInst::isStructReturn() const {
/// @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) {