summaryrefslogtreecommitdiff
path: root/lib/IR/Function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/IR/Function.cpp')
-rw-r--r--lib/IR/Function.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/IR/Function.cpp b/lib/IR/Function.cpp
index 970bbaeed8..bb6bef7bd0 100644
--- a/lib/IR/Function.cpp
+++ b/lib/IR/Function.cpp
@@ -736,10 +736,8 @@ bool Function::isDefTriviallyDead() const {
bool Function::callsFunctionThatReturnsTwice() const {
for (const_inst_iterator
I = inst_begin(this), E = inst_end(this); I != E; ++I) {
- const CallInst* callInst = dyn_cast<CallInst>(&*I);
- if (!callInst)
- continue;
- if (callInst->canReturnTwice())
+ ImmutableCallSite CS(&*I);
+ if (CS && CS.hasFnAttr(Attribute::ReturnsTwice))
return true;
}