summaryrefslogtreecommitdiff
path: root/lib/Analysis/IPA/CallGraph.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-02-12 21:07:25 +0000
committerChris Lattner <sabre@nondot.org>2002-02-12 21:07:25 +0000
commit221d688a5ef21a22c2368c9fff0e92d7966c95e5 (patch)
treed2dc21b19341a39bdc0a47f4736d76839d9ad73b /lib/Analysis/IPA/CallGraph.cpp
parent3c34a46c7e51ab290b208248461542eb83c469b0 (diff)
downloadllvm-221d688a5ef21a22c2368c9fff0e92d7966c95e5.tar.gz
llvm-221d688a5ef21a22c2368c9fff0e92d7966c95e5.tar.bz2
llvm-221d688a5ef21a22c2368c9fff0e92d7966c95e5.tar.xz
Method.h no longer includes BasicBlock.h
Method::inst_* is now in llvm/Support/InstIterator.h GraphTraits specializations for BasicBlock and Methods are now in llvm/Support/CFG.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r--lib/Analysis/IPA/CallGraph.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index 244c35ea46..04b8c2d6bc 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/lib/Analysis/IPA/CallGraph.cpp
@@ -16,6 +16,7 @@
#include "llvm/Method.h"
#include "llvm/iOther.h"
#include "llvm/iTerminators.h"
+#include "llvm/Support/InstIterator.h"// FIXME: CallGraph should use method uses
#include "Support/STLExtras.h"
#include <algorithm>
@@ -46,8 +47,7 @@ void cfg::CallGraph::addToCallGraph(Method *M) {
if (!M->hasInternalLinkage())
Root->addCalledMethod(Node);
- for (Method::inst_iterator I = M->inst_begin(), E = M->inst_end();
- I != E; ++I) {
+ for (inst_iterator I = inst_begin(M), E = inst_end(M); I != E; ++I) {
// Dynamic calls will cause Null nodes to be created
if (CallInst *CI = dyn_cast<CallInst>(*I))
Node->addCalledMethod(getNodeFor(CI->getCalledMethod()));
@@ -138,8 +138,7 @@ bool IsLeafMethod(const Method* M, const cfg::CallGraph* CG) {
return (cgn->begin() == cgn->end());
}
- for (Method::const_inst_iterator I = M->inst_begin(), E = M->inst_end();
- I != E; ++I)
+ for (const_inst_iterator I = inst_begin(M), E = inst_end(M); I != E; ++I)
if ((*I)->getOpcode() == Instruction::Call)
return false;
return true;