diff options
author | Chris Lattner <sabre@nondot.org> | 2002-02-12 21:07:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-02-12 21:07:25 +0000 |
commit | 221d688a5ef21a22c2368c9fff0e92d7966c95e5 (patch) | |
tree | d2dc21b19341a39bdc0a47f4736d76839d9ad73b /lib/Analysis/IPA | |
parent | 3c34a46c7e51ab290b208248461542eb83c469b0 (diff) | |
download | external_llvm-221d688a5ef21a22c2368c9fff0e92d7966c95e5.zip external_llvm-221d688a5ef21a22c2368c9fff0e92d7966c95e5.tar.gz external_llvm-221d688a5ef21a22c2368c9fff0e92d7966c95e5.tar.bz2 |
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')
-rw-r--r-- | lib/Analysis/IPA/CallGraph.cpp | 7 | ||||
-rw-r--r-- | lib/Analysis/IPA/FindUnsafePointerTypes.cpp | 4 | ||||
-rw-r--r-- | lib/Analysis/IPA/FindUsedTypes.cpp | 3 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp index 244c35e..04b8c2d 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; diff --git a/lib/Analysis/IPA/FindUnsafePointerTypes.cpp b/lib/Analysis/IPA/FindUnsafePointerTypes.cpp index bc09292..0179cbb 100644 --- a/lib/Analysis/IPA/FindUnsafePointerTypes.cpp +++ b/lib/Analysis/IPA/FindUnsafePointerTypes.cpp @@ -22,6 +22,7 @@ #include "llvm/Instruction.h" #include "llvm/Method.h" #include "llvm/Module.h" +#include "llvm/Support/InstIterator.h" #include "Support/CommandLine.h" AnalysisID FindUnsafePointerTypes::ID(AnalysisID::create<FindUnsafePointerTypes>()); @@ -58,8 +59,7 @@ bool FindUnsafePointerTypes::run(Module *Mod) { for (Module::iterator MI = Mod->begin(), ME = Mod->end(); MI != ME; ++MI) { const Method *M = *MI; // We don't need/want write access - 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) { const Instruction *Inst = *I; const Type *ITy = Inst->getType(); if (ITy->isPointerType() && !UnsafeTypes.count((PointerType*)ITy)) diff --git a/lib/Analysis/IPA/FindUsedTypes.cpp b/lib/Analysis/IPA/FindUsedTypes.cpp index b876e5e..e02429a 100644 --- a/lib/Analysis/IPA/FindUsedTypes.cpp +++ b/lib/Analysis/IPA/FindUsedTypes.cpp @@ -11,6 +11,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Module.h" #include "llvm/Method.h" +#include "llvm/Support/InstIterator.h" AnalysisID FindUsedTypes::ID(AnalysisID::create<FindUsedTypes>()); AnalysisID FindUsedTypes::IncludeSymbolTableID(AnalysisID::create<FindUsedTypes>()); @@ -59,7 +60,7 @@ bool FindUsedTypes::run(Module *m) { // Loop over all of the instructions in the method, adding their return type // as well as the types of their operands. // - for (Method::const_inst_iterator II = M->inst_begin(), IE = M->inst_end(); + for (const_inst_iterator II = inst_begin(M), IE = inst_end(M); II != IE; ++II) { const Instruction *I = *II; const Type *Ty = I->getType(); |