summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instructions.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-11-29 08:30:15 +0000
committerDuncan Sands <baldrick@free.fr>2007-11-29 08:30:15 +0000
commit8dfcd5975edf09eb74cc7828e2223c498e82967c (patch)
tree4d5e6a35a45142fe53c66129c89987bb4c0f2d27 /llvm/lib/VMCore/Instructions.cpp
parentf5a095359e1dd003e4043ce0551cfa32df24fc73 (diff)
downloadbcm5719-llvm-8dfcd5975edf09eb74cc7828e2223c498e82967c.tar.gz
bcm5719-llvm-8dfcd5975edf09eb74cc7828e2223c498e82967c.zip
Small parameter attributes cleanup.
llvm-svn: 44433
Diffstat (limited to 'llvm/lib/VMCore/Instructions.cpp')
-rw-r--r--llvm/lib/VMCore/Instructions.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index 8e484910d2d..7ad588c72ea 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/lib/VMCore/Instructions.cpp
@@ -385,8 +385,9 @@ void CallInst::setParamAttrs(const ParamAttrsList *newAttrs) {
bool CallInst::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
if (ParamAttrs && ParamAttrs->paramHasAttr(i, attr))
return true;
- const Function *F = getCalledFunction();
- return F && F->getParamAttrs() && F->getParamAttrs()->paramHasAttr(i, attr);
+ if (const Function *F = getCalledFunction())
+ return F->paramHasAttr(i, attr);
+ return false;
}
@@ -462,8 +463,9 @@ void InvokeInst::setParamAttrs(const ParamAttrsList *newAttrs) {
bool InvokeInst::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
if (ParamAttrs && ParamAttrs->paramHasAttr(i, attr))
return true;
- const Function *F = getCalledFunction();
- return F && F->getParamAttrs() && F->getParamAttrs()->paramHasAttr(i, attr);
+ if (const Function *F = getCalledFunction())
+ return F->paramHasAttr(i, attr);
+ return false;
}
OpenPOWER on IntegriCloud