summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-01 13:19:53 +0000
committerChris Lattner <sabre@nondot.org>2001-10-01 13:19:53 +0000
commitba1c1f2fb67148c016861a0c535af8a0af173cce (patch)
treeddfb3a6170a7cc77b26d600cefba1ff81072bbdd /llvm/lib/VMCore
parenta7610016a5ba5dacf41f65c25774cc4e198418e5 (diff)
downloadbcm5719-llvm-ba1c1f2fb67148c016861a0c535af8a0af173cce.tar.gz
bcm5719-llvm-ba1c1f2fb67148c016861a0c535af8a0af173cce.zip
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. llvm-svn: 691
Diffstat (limited to 'llvm/lib/VMCore')
-rw-r--r--llvm/lib/VMCore/BasicBlock.cpp6
-rw-r--r--llvm/lib/VMCore/Dominators.cpp14
2 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/VMCore/BasicBlock.cpp b/llvm/lib/VMCore/BasicBlock.cpp
index 4c480db631c..7d97c85f7de 100644
--- a/llvm/lib/VMCore/BasicBlock.cpp
+++ b/llvm/lib/VMCore/BasicBlock.cpp
@@ -10,7 +10,6 @@
#include "llvm/Method.h"
#include "llvm/SymbolTable.h"
#include "llvm/Type.h"
-#include "llvm/CFG.h"
#include "llvm/iOther.h"
#include "llvm/CodeGen/MachineInstr.h"
@@ -91,12 +90,11 @@ bool BasicBlock::hasConstantPoolReferences() const {
// called while the predecessor still refers to this block.
//
void BasicBlock::removePredecessor(BasicBlock *Pred) {
- using cfg::pred_begin; using cfg::pred_end; using cfg::pred_iterator;
- assert(find(pred_begin(this), pred_end(this), Pred) != pred_end(this) &&
+ assert(find(pred_begin(), pred_end(), Pred) != pred_end() &&
"removePredecessor: BB is not a predecessor!");
if (!front()->isPHINode()) return; // Quick exit.
- pred_iterator PI(pred_begin(this)), EI(pred_end(this));
+ pred_iterator PI(pred_begin()), EI(pred_end());
unsigned max_idx;
// Loop over the rest of the predecessors until we run out, or until we find
diff --git a/llvm/lib/VMCore/Dominators.cpp b/llvm/lib/VMCore/Dominators.cpp
index 03721415051..c241646b636 100644
--- a/llvm/lib/VMCore/Dominators.cpp
+++ b/llvm/lib/VMCore/Dominators.cpp
@@ -63,7 +63,8 @@ void cfg::DominatorSet::calcForwardDominatorSet(const Method *M) {
df_iterator<const Method*> It = df_begin(M), End = df_end(M);
for ( ; It != End; ++It) {
const BasicBlock *BB = *It;
- pred_const_iterator PI = pred_begin(BB), PEnd = pred_end(BB);
+ BasicBlock::pred_const_iterator PI = BB->pred_begin(),
+ PEnd = BB->pred_end();
if (PI != PEnd) { // Is there SOME predecessor?
// Loop until we get to a predecessor that has had it's dom set filled
// in at least once. We are guaranteed to have this because we are
@@ -114,7 +115,8 @@ cfg::DominatorSet::DominatorSet(Method *M, bool PostDomSet)
idf_iterator<const BasicBlock*> It = idf_begin(Root), End = idf_end(Root);
for ( ; It != End; ++It) {
const BasicBlock *BB = *It;
- succ_const_iterator PI = succ_begin(BB), PEnd = succ_end(BB);
+ BasicBlock::succ_const_iterator PI = BB->succ_begin(),
+ PEnd = BB->succ_end();
if (PI != PEnd) { // Is there SOME predecessor?
// Loop until we get to a successor that has had it's dom set filled
// in at least once. We are guaranteed to have this because we are
@@ -320,8 +322,8 @@ cfg::DominanceFrontier::calcDomFrontier(const DominatorTree &DT,
const BasicBlock *BB = Node->getNode();
DomSetType &S = Frontiers[BB]; // The new set to fill in...
- for (succ_const_iterator SI = succ_begin(BB), SE = succ_end(BB);
- SI != SE; ++SI) {
+ for (BasicBlock::succ_const_iterator SI = BB->succ_begin(),
+ SE = BB->succ_end(); SI != SE; ++SI) {
// Does Node immediately dominate this successor?
if (DT[*SI]->getIDom() != Node)
S.insert(*SI);
@@ -354,8 +356,8 @@ cfg::DominanceFrontier::calcPostDomFrontier(const DominatorTree &DT,
DomSetType &S = Frontiers[BB]; // The new set to fill in...
if (!Root) return S;
- for (pred_const_iterator SI = pred_begin(BB), SE = pred_end(BB);
- SI != SE; ++SI) {
+ for (BasicBlock::pred_const_iterator SI = BB->pred_begin(),
+ SE = BB->pred_end(); SI != SE; ++SI) {
// Does Node immediately dominate this predeccessor?
if (DT[*SI]->getIDom() != Node)
S.insert(*SI);
OpenPOWER on IntegriCloud