summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Dominators.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2007-10-03 03:20:17 +0000
committerOwen Anderson <resistor@mac.com>2007-10-03 03:20:17 +0000
commitb60f254975a387d58d2d173531c5a9d844c82c47 (patch)
tree29eec17ebbb2d09d765e35f8ac73c7b81b506fe7 /llvm/lib/VMCore/Dominators.cpp
parent88b7439a8c068de725013c5fd4d7d9b12479c3f0 (diff)
downloadbcm5719-llvm-b60f254975a387d58d2d173531c5a9d844c82c47.tar.gz
bcm5719-llvm-b60f254975a387d58d2d173531c5a9d844c82c47.zip
Factor some code from the DomTree and PostDomTree calculate methods up into
each one's runOnFunction method. llvm-svn: 42563
Diffstat (limited to 'llvm/lib/VMCore/Dominators.cpp')
-rw-r--r--llvm/lib/VMCore/Dominators.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Dominators.cpp b/llvm/lib/VMCore/Dominators.cpp
index a1eaf4aa971..57cf6702868 100644
--- a/llvm/lib/VMCore/Dominators.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud