Pull predecessor and successor iterators out of the CFG*.h files, and plop them into

the BasicBlock class where they should be.  pred_begin/pred_end become methods on BasicBlock,
and the cfg namespace isn't used anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@691 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2001-10-01 13:19:53 +00:00
parent 711774e169
commit f0604b84c7
16 changed files with 176 additions and 368 deletions

View File

@@ -26,7 +26,6 @@
#include "llvm/Support/STLExtras.h"
#include "llvm/SymbolTable.h"
#include "llvm/iOther.h"
#include "llvm/CFG.h"
#include <algorithm>
#include "llvm/Analysis/LoopDepth.h"
@@ -199,12 +198,12 @@ static PHINode *InjectSimpleInductionVariable(cfg::Interval *Int) {
// Figure out which predecessors I have to play with... there should be
// exactly two... one of which is a loop predecessor, and one of which is not.
//
cfg::pred_iterator PI = cfg::pred_begin(Header);
assert(PI != cfg::pred_end(Header) && "Header node should have 2 preds!");
BasicBlock::pred_iterator PI = Header->pred_begin();
assert(PI != Header->pred_end() && "Header node should have 2 preds!");
BasicBlock *Pred1 = *PI; ++PI;
assert(PI != cfg::pred_end(Header) && "Header node should have 2 preds!");
assert(PI != Header->pred_end() && "Header node should have 2 preds!");
BasicBlock *Pred2 = *PI;
assert(++PI == cfg::pred_end(Header) && "Header node should have 2 preds!");
assert(++PI == Header->pred_end() && "Header node should have 2 preds!");
// Make Pred1 be the loop entrance predecessor, Pred2 be the Loop predecessor
if (Int->contains(Pred1)) swap(Pred1, Pred2);