diff options
author | Duncan Sands <baldrick@free.fr> | 2008-01-21 11:27:55 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-01-21 11:27:55 +0000 |
commit | 53d4afcee998f6861ce4056c48c9729c489d7a9a (patch) | |
tree | 38950b0a1d59e77740b4476f29276357d367e1be | |
parent | da9bb3578ed4f57b7e1f5393dfae85ccdf76b4af (diff) |
Be consistent with other attribute methods, and
check the callee also if it is known.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46206 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/VMCore/Instructions.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index ca9ea3bfa3..156eff169c 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -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) { |