diff options
author | Chris Lattner <sabre@nondot.org> | 2002-02-12 21:04:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-02-12 21:04:35 +0000 |
commit | 3c34a46c7e51ab290b208248461542eb83c469b0 (patch) | |
tree | 9964fff6b5359395d5dce73cbdab99c5b7dce26f | |
parent | 428039a6e11efa85e82cc29675e1c9c54130f2d6 (diff) |
Method.h no longer includes BasicBlock.h
Method::inst_* is now in llvm/Support/InstIterator.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1745 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Analysis/ConstantsScanner.h | 10 | ||||
-rw-r--r-- | include/llvm/Analysis/InstForest.h | 17 | ||||
-rw-r--r-- | include/llvm/Analysis/IntervalIterator.h | 1 | ||||
-rw-r--r-- | include/llvm/Transforms/Scalar/DCE.h | 1 |
4 files changed, 18 insertions, 11 deletions
diff --git a/include/llvm/Analysis/ConstantsScanner.h b/include/llvm/Analysis/ConstantsScanner.h index 69e97d53f9..1a85082002 100644 --- a/include/llvm/Analysis/ConstantsScanner.h +++ b/include/llvm/Analysis/ConstantsScanner.h @@ -9,14 +9,14 @@ #ifndef LLVM_ANALYSIS_CONSTANTSSCANNER_H #define LLVM_ANALYSIS_CONSTANTSSCANNER_H -#include "llvm/Method.h" +#include "llvm/Support/InstIterator.h" #include "llvm/Instruction.h" #include <iterator> class Constant; class constant_iterator : public std::forward_iterator<const Constant, ptrdiff_t> { - Method::const_inst_iterator InstI; // Method instruction iterator + const_inst_iterator InstI; // Method instruction iterator unsigned OpIdx; // Operand index typedef constant_iterator _Self; @@ -28,15 +28,15 @@ class constant_iterator } public: - inline constant_iterator(const Method *M) : InstI(M->inst_begin()), OpIdx(0) { + inline constant_iterator(const Method *M) : InstI(inst_begin(M)), OpIdx(0) { // Advance to first constant... if we are not already at constant or end - if (InstI != M->inst_end() && // InstI is valid? + if (InstI != inst_end(M) && // InstI is valid? (InstI->getNumOperands() == 0 || !isAtConstant())) // Not at constant? operator++(); } inline constant_iterator(const Method *M, bool) // end ctor - : InstI(M->inst_end()), OpIdx(0) { + : InstI(inst_end(M)), OpIdx(0) { } inline bool operator==(const _Self& x) const { return OpIdx == x.OpIdx && diff --git a/include/llvm/Analysis/InstForest.h b/include/llvm/Analysis/InstForest.h index efcbf519f6..aacbb13fb7 100644 --- a/include/llvm/Analysis/InstForest.h +++ b/include/llvm/Analysis/InstForest.h @@ -15,6 +15,7 @@ #define LLVM_ANALYSIS_INSTFOREST_H #include "llvm/Instruction.h" +#include "llvm/BasicBlock.h" #include "Support/Tree.h" #include <map> @@ -163,12 +164,16 @@ class InstForest : public std::vector<InstTreeNode<Payload> *> { public: // ctor - Create an instruction forest for the specified method... InstForest(Method *M) { - for (Method::inst_iterator I = M->inst_begin(), E = M->inst_end(); - I != E; ++I) { - Instruction *Inst = *I; - if (!getInstNode(Inst)) // Do we already have a tree for this inst? - push_back(new InstTreeNode<Payload>(*this, Inst, 0)); // No create one! - // InstTreeNode ctor automatically adds the created node into our InstMap + for (Method::iterator MI = M->begin(), ME = M->end(); MI != ME; ++MI) { + BasicBlock *BB = *MI; + for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) { + Instruction *Inst = *I; + if (!getInstNode(Inst)) { // Do we already have a tree for this inst? + // No, create one! InstTreeNode ctor automatically adds the + // created node into our InstMap + push_back(new InstTreeNode<Payload>(*this, Inst, 0)); + } + } } } diff --git a/include/llvm/Analysis/IntervalIterator.h b/include/llvm/Analysis/IntervalIterator.h index 52d2cc807d..05add884fd 100644 --- a/include/llvm/Analysis/IntervalIterator.h +++ b/include/llvm/Analysis/IntervalIterator.h @@ -28,6 +28,7 @@ #include "llvm/Analysis/IntervalPartition.h" #include "llvm/Method.h" +#include "llvm/BasicBlock.h" #include <stack> #include <set> #include <algorithm> diff --git a/include/llvm/Transforms/Scalar/DCE.h b/include/llvm/Transforms/Scalar/DCE.h index 6fc5287e42..3246ed85e5 100644 --- a/include/llvm/Transforms/Scalar/DCE.h +++ b/include/llvm/Transforms/Scalar/DCE.h @@ -10,6 +10,7 @@ #include "llvm/Pass.h" #include "llvm/Method.h" +#include "llvm/BasicBlock.h" //===----------------------------------------------------------------------===// // DeadInstElimination - This pass quickly removes trivially dead instructions |