diff options
Diffstat (limited to 'llvm/lib/Analysis/IPA/CallGraph.cpp')
| -rw-r--r-- | llvm/lib/Analysis/IPA/CallGraph.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp index b1a272f032e..87dbf2b4255 100644 --- a/llvm/lib/Analysis/IPA/CallGraph.cpp +++ b/llvm/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())); - } } } |

