summaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-02-12 22:39:50 +0000
committerChris Lattner <sabre@nondot.org>2002-02-12 22:39:50 +0000
commit455889aa79e3463a4b0f2161e3d9d72a683268b6 (patch)
treeaf1cb8e20b69e33a7a744365fb6e15445abf81ed /lib/Analysis
parentcc179d3ab85fd19c3fd9586409c69d14fbb6c642 (diff)
downloadllvm-455889aa79e3463a4b0f2161e3d9d72a683268b6.tar.gz
llvm-455889aa79e3463a4b0f2161e3d9d72a683268b6.tar.bz2
llvm-455889aa79e3463a4b0f2161e3d9d72a683268b6.tar.xz
* Pull BasicBlock::pred_* and BasicBlock::succ_* out of BasicBlock.h and into
llvm/Support/CFG.h * Make pred & succ iterators for intervals global functions * Add #includes that are now neccesary because BasicBlock.h doesn't include InstrTypes.h anymore git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1750 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/IPA/FindUsedTypes.cpp1
-rw-r--r--lib/Analysis/Interval.cpp5
-rw-r--r--lib/Analysis/LiveVar/BBLiveVar.cpp5
-rw-r--r--lib/Analysis/LoopInfo.cpp5
-rw-r--r--lib/Analysis/PostDominators.cpp16
5 files changed, 16 insertions, 16 deletions
diff --git a/lib/Analysis/IPA/FindUsedTypes.cpp b/lib/Analysis/IPA/FindUsedTypes.cpp
index e02429ab97..e67fe322f7 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/Instruction.h"
#include "llvm/Support/InstIterator.h"
AnalysisID FindUsedTypes::ID(AnalysisID::create<FindUsedTypes>());
diff --git a/lib/Analysis/Interval.cpp b/lib/Analysis/Interval.cpp
index 5c68be9c2e..de5d57f85e 100644
--- a/lib/Analysis/Interval.cpp
+++ b/lib/Analysis/Interval.cpp
@@ -7,6 +7,7 @@
#include "llvm/Analysis/Interval.h"
#include "llvm/BasicBlock.h"
+#include "llvm/Support/CFG.h"
//===----------------------------------------------------------------------===//
// Interval Implementation
@@ -17,8 +18,8 @@
bool cfg::Interval::isLoop() const {
// There is a loop in this interval iff one of the predecessors of the header
// node lives in the interval.
- for (BasicBlock::pred_iterator I = HeaderNode->pred_begin(),
- E = HeaderNode->pred_end(); I != E; ++I) {
+ for (::pred_iterator I = ::pred_begin(HeaderNode), E = ::pred_end(HeaderNode);
+ I != E; ++I) {
if (contains(*I)) return true;
}
return false;
diff --git a/lib/Analysis/LiveVar/BBLiveVar.cpp b/lib/Analysis/LiveVar/BBLiveVar.cpp
index 84adecda6d..1468301dfc 100644
--- a/lib/Analysis/LiveVar/BBLiveVar.cpp
+++ b/lib/Analysis/LiveVar/BBLiveVar.cpp
@@ -8,6 +8,7 @@
#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/BasicBlock.h"
+#include "llvm/Support/CFG.h"
#include "Support/SetOperations.h"
/// BROKEN: Should not include sparc stuff directly into here
@@ -197,8 +198,8 @@ bool BBLiveVar::applyFlowFunc() {
//
bool needAnotherIt = false;
- for (BasicBlock::pred_const_iterator PI = BB->pred_begin(),
- PE = BB->pred_begin(); PI != PE ; ++PI) {
+ for (pred_const_iterator PI = pred_begin(BB), PE = pred_begin(BB);
+ PI != PE ; ++PI) {
BBLiveVar *PredLVBB = BBLiveVar::GetFromBB(*PI);
// do set union
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp
index 876161d34f..344e3a446b 100644
--- a/lib/Analysis/LoopInfo.cpp
+++ b/lib/Analysis/LoopInfo.cpp
@@ -61,8 +61,7 @@ cfg::Loop *cfg::LoopInfo::ConsiderForLoop(const BasicBlock *BB,
// Scan the predecessors of BB, checking to see if BB dominates any of
// them.
- for (BasicBlock::pred_const_iterator I = BB->pred_begin(),
- E = BB->pred_end(); I != E; ++I)
+ for (pred_const_iterator I = pred_begin(BB), E = pred_end(BB); I != E; ++I)
if (DS.dominates(BB, *I)) // If BB dominates it's predecessor...
TodoStack.push_back(*I);
@@ -80,7 +79,7 @@ cfg::Loop *cfg::LoopInfo::ConsiderForLoop(const BasicBlock *BB,
L->Blocks.push_back(X);
// Add all of the predecessors of X to the end of the work stack...
- TodoStack.insert(TodoStack.end(), X->pred_begin(), X->pred_end());
+ TodoStack.insert(TodoStack.end(), pred_begin(X), pred_end(X));
}
}
diff --git a/lib/Analysis/PostDominators.cpp b/lib/Analysis/PostDominators.cpp
index 33e14e9fc5..48cc86fcaf 100644
--- a/lib/Analysis/PostDominators.cpp
+++ b/lib/Analysis/PostDominators.cpp
@@ -37,7 +37,7 @@ bool cfg::DominatorSet::runOnMethod(Method *M) {
//
void cfg::DominatorSet::calcForwardDominatorSet(Method *M) {
Root = M->getEntryNode();
- assert(Root->pred_begin() == Root->pred_end() &&
+ assert(pred_begin(Root) == pred_end(Root) &&
"Root node has predecessors in method!");
bool Changed;
@@ -48,8 +48,7 @@ void cfg::DominatorSet::calcForwardDominatorSet(Method *M) {
df_iterator<Method*> It = df_begin(M), End = df_end(M);
for ( ; It != End; ++It) {
const BasicBlock *BB = *It;
- BasicBlock::pred_const_iterator PI = BB->pred_begin(),
- PEnd = BB->pred_end();
+ pred_const_iterator PI = pred_begin(BB), PEnd = pred_end(BB);
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
@@ -102,8 +101,7 @@ void cfg::DominatorSet::calcPostDominatorSet(Method *M) {
idf_iterator<BasicBlock*> It = idf_begin(Root), End = idf_end(Root);
for ( ; It != End; ++It) {
const BasicBlock *BB = *It;
- BasicBlock::succ_const_iterator PI = BB->succ_begin(),
- PEnd = BB->succ_end();
+ succ_const_iterator PI = succ_begin(BB), PEnd = succ_end(BB);
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
@@ -337,8 +335,8 @@ cfg::DominanceFrontier::calcDomFrontier(const DominatorTree &DT,
const BasicBlock *BB = Node->getNode();
DomSetType &S = Frontiers[BB]; // The new set to fill in...
- for (BasicBlock::succ_const_iterator SI = BB->succ_begin(),
- SE = BB->succ_end(); SI != SE; ++SI) {
+ for (succ_const_iterator SI = succ_begin(BB), SE = succ_end(BB);
+ SI != SE; ++SI) {
// Does Node immediately dominate this successor?
if (DT[*SI]->getIDom() != Node)
S.insert(*SI);
@@ -371,8 +369,8 @@ cfg::DominanceFrontier::calcPostDomFrontier(const DominatorTree &DT,
DomSetType &S = Frontiers[BB]; // The new set to fill in...
if (!Root) return S;
- for (BasicBlock::pred_const_iterator SI = BB->pred_begin(),
- SE = BB->pred_end(); SI != SE; ++SI) {
+ for (pred_const_iterator SI = pred_begin(BB), SE = pred_end(BB);
+ SI != SE; ++SI) {
// Does Node immediately dominate this predeccessor?
if (DT[*SI]->getIDom() != Node)
S.insert(*SI);