aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-06-11 15:40:48 +0000
committerDevang Patel <dpatel@apple.com>2007-06-11 15:40:48 +0000
commit2099ff065d5256883d278acb70a44e36b62a6436 (patch)
tree54ebb00150b18589bbe83437ce46dfd06985c94e /lib/VMCore
parenta9bf49c7e321b789088779a608f3aa9287343982 (diff)
downloadexternal_llvm-2099ff065d5256883d278acb70a44e36b62a6436.zip
external_llvm-2099ff065d5256883d278acb70a44e36b62a6436.tar.gz
external_llvm-2099ff065d5256883d278acb70a44e36b62a6436.tar.bz2
Use DominatorTree instead of ETForest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37538 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Verifier.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index ef7b3f8..3442149 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -76,7 +76,7 @@ namespace { // Anonymous namespace for class
VerifierFailureAction action;
// What to do if verification fails.
Module *Mod; // Module we are verifying right now
- ETForest *EF; // ET-Forest, caution can be null!
+ DominatorTree *DT; // Dominator Tree, caution can be null!
std::stringstream msgs; // A stringstream to collect messages
/// InstInThisBlock - when verifying a basic block, keep track of all of the
@@ -88,20 +88,20 @@ namespace { // Anonymous namespace for class
Verifier()
: FunctionPass((intptr_t)&ID),
Broken(false), RealPass(true), action(AbortProcessAction),
- EF(0), msgs( std::ios::app | std::ios::out ) {}
+ DT(0), msgs( std::ios::app | std::ios::out ) {}
Verifier( VerifierFailureAction ctn )
: FunctionPass((intptr_t)&ID),
- Broken(false), RealPass(true), action(ctn), EF(0),
+ Broken(false), RealPass(true), action(ctn), DT(0),
msgs( std::ios::app | std::ios::out ) {}
Verifier(bool AB )
: FunctionPass((intptr_t)&ID),
Broken(false), RealPass(true),
- action( AB ? AbortProcessAction : PrintMessageAction), EF(0),
+ action( AB ? AbortProcessAction : PrintMessageAction), DT(0),
msgs( std::ios::app | std::ios::out ) {}
- Verifier(ETForest &ef)
+ Verifier(DominatorTree &dt)
: FunctionPass((intptr_t)&ID),
Broken(false), RealPass(false), action(PrintMessageAction),
- EF(&ef), msgs( std::ios::app | std::ios::out ) {}
+ DT(&dt), msgs( std::ios::app | std::ios::out ) {}
bool doInitialization(Module &M) {
@@ -118,7 +118,7 @@ namespace { // Anonymous namespace for class
bool runOnFunction(Function &F) {
// Get dominator information if we are being run by PassManager
- if (RealPass) EF = &getAnalysis<ETForest>();
+ if (RealPass) DT = &getAnalysis<DominatorTree>();
Mod = F.getParent();
@@ -158,7 +158,7 @@ namespace { // Anonymous namespace for class
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
if (RealPass)
- AU.addRequired<ETForest>();
+ AU.addRequired<DominatorTree>();
}
/// abortIfBroken - If the module is broken and we are supposed to abort on
@@ -879,7 +879,7 @@ void Verifier::visitInstruction(Instruction &I) {
for (Value::use_iterator UI = I.use_begin(), UE = I.use_end();
UI != UE; ++UI)
Assert1(*UI != (User*)&I ||
- !EF->dominates(&BB->getParent()->getEntryBlock(), BB),
+ !DT->dominates(&BB->getParent()->getEntryBlock(), BB),
"Only PHI nodes may reference their own value!", &I);
}
@@ -948,7 +948,7 @@ void Verifier::visitInstruction(Instruction &I) {
// dominates all of it's predecessors (other than the invoke) or if
// the invoke value is only used by a phi in the successor.
if (!OpBlock->getSinglePredecessor() &&
- EF->dominates(&BB->getParent()->getEntryBlock(), BB)) {
+ DT->dominates(&BB->getParent()->getEntryBlock(), BB)) {
// The first case we allow is if the use is a PHI operand in the
// normal block, and if that PHI operand corresponds to the invoke's
// block.
@@ -965,7 +965,7 @@ void Verifier::visitInstruction(Instruction &I) {
Bad = false;
for (pred_iterator PI = pred_begin(OpBlock),
E = pred_end(OpBlock); PI != E; ++PI) {
- if (*PI != II->getParent() && !EF->dominates(OpBlock, *PI)) {
+ if (*PI != II->getParent() && !DT->dominates(OpBlock, *PI)) {
Bad = true;
break;
}
@@ -979,20 +979,20 @@ void Verifier::visitInstruction(Instruction &I) {
// If they are in the same basic block, make sure that the definition
// comes before the use.
Assert2(InstsInThisBlock.count(Op) ||
- !EF->dominates(&BB->getParent()->getEntryBlock(), BB),
+ !DT->dominates(&BB->getParent()->getEntryBlock(), BB),
"Instruction does not dominate all uses!", Op, &I);
}
// Definition must dominate use unless use is unreachable!
- Assert2(EF->dominates(OpBlock, BB) ||
- !EF->dominates(&BB->getParent()->getEntryBlock(), BB),
+ Assert2(DT->dominates(OpBlock, BB) ||
+ !DT->dominates(&BB->getParent()->getEntryBlock(), BB),
"Instruction does not dominate all uses!", Op, &I);
} else {
// PHI nodes are more difficult than other nodes because they actually
// "use" the value in the predecessor basic blocks they correspond to.
BasicBlock *PredBB = cast<BasicBlock>(I.getOperand(i+1));
- Assert2(EF->dominates(OpBlock, PredBB) ||
- !EF->dominates(&BB->getParent()->getEntryBlock(), PredBB),
+ Assert2(DT->dominates(OpBlock, PredBB) ||
+ !DT->dominates(&BB->getParent()->getEntryBlock(), PredBB),
"Instruction does not dominate all uses!", Op, &I);
}
} else if (isa<InlineAsm>(I.getOperand(i))) {