aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/IPA/CallGraph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r--lib/Analysis/IPA/CallGraph.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index b1a272f032..87dbf2b425 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/lib/Analysis/IPA/CallGraph.cpp
@@ -38,10 +38,8 @@ void CallGraph::addToCallGraph(Method *M) {
for (Method::inst_iterator II = M->inst_begin(), IE = M->inst_end();
II != IE; ++II) {
- if (II->getOpcode() == Instruction::Call) {
- CallInst *CI = (CallInst*)*II;
+ if (CallInst *CI = dyn_cast<CallInst>(*II))
Node->addCalledMethod(getNodeFor(CI->getCalledMethod()));
- }
}
}