summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-01-21 11:27:55 +0000
committerDuncan Sands <baldrick@free.fr>2008-01-21 11:27:55 +0000
commita59f396cba15449568df52983f4463215166bcf7 (patch)
tree4b38aa4cc2ee83046aa6fd5718378d906c9c1b32 /llvm/lib
parent59e0e4bf35f754f000a45d18e4976673a2272b29 (diff)
downloadbcm5719-llvm-a59f396cba15449568df52983f4463215166bcf7.tar.gz
bcm5719-llvm-a59f396cba15449568df52983f4463215166bcf7.zip
Be consistent with other attribute methods, and
check the callee also if it is known. llvm-svn: 46206
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Instructions.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index ca9ea3bfa3b..156eff169c1 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/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) {
OpenPOWER on IntegriCloud