aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/DominatorCalculation.h2
-rw-r--r--lib/VMCore/Dominators.cpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/VMCore/DominatorCalculation.h b/lib/VMCore/DominatorCalculation.h
index a9118d8..1d245d4 100644
--- a/lib/VMCore/DominatorCalculation.h
+++ b/lib/VMCore/DominatorCalculation.h
@@ -40,8 +40,6 @@ void DTcalculate(DominatorTree& DT, Function &F) {
// Add a node for the root...
DT.DomTreeNodes[Root] = DT.RootNode = new DomTreeNode(Root, 0);
- DT.Vertex.push_back(0);
-
// Step #1: Number blocks in depth-first order and initialize variables used
// in later stages of the algorithm.
unsigned N = DFSPass<GraphTraits<BasicBlock*> >(DT, Root, 0);
diff --git a/lib/VMCore/Dominators.cpp b/lib/VMCore/Dominators.cpp
index a1eaf4a..57cf670 100644
--- a/lib/VMCore/Dominators.cpp
+++ b/lib/VMCore/Dominators.cpp
@@ -350,7 +350,13 @@ void DominatorTreeBase::dump() {
bool DominatorTree::runOnFunction(Function &F) {
reset(); // Reset from the last time we were run...
+
+ // Initialize roots
Roots.push_back(&F.getEntryBlock());
+ IDoms[&F.getEntryBlock()] = 0;
+ DomTreeNodes[&F.getEntryBlock()] = 0;
+ Vertex.push_back(0);
+
DTcalculate(*this, F);
return false;
}