aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Instructions.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index ca9ea3b..156eff1 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) {