summaryrefslogtreecommitdiff
path: root/lib/Analysis/PostDominators.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2007-04-07 07:17:27 +0000
committerOwen Anderson <resistor@mac.com>2007-04-07 07:17:27 +0000
commitba43963e96c9eb28d4f6862e46c5d3fbdc1f3b96 (patch)
treec7431cd8d0b9ae7636f55866f7afbf1f76bb827a /lib/Analysis/PostDominators.cpp
parent4f9e58ecdf247f87a9b7cef69b1fa37fb5b07f0d (diff)
downloadllvm-ba43963e96c9eb28d4f6862e46c5d3fbdc1f3b96.tar.gz
llvm-ba43963e96c9eb28d4f6862e46c5d3fbdc1f3b96.tar.bz2
llvm-ba43963e96c9eb28d4f6862e46c5d3fbdc1f3b96.tar.xz
Completely purge DomSet. This is the (hopefully) final patch for PR1171.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35731 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PostDominators.cpp')
-rw-r--r--lib/Analysis/PostDominators.cpp67
1 files changed, 0 insertions, 67 deletions
diff --git a/lib/Analysis/PostDominators.cpp b/lib/Analysis/PostDominators.cpp
index d1fe9dd7f6..24399405fc 100644
--- a/lib/Analysis/PostDominators.cpp
+++ b/lib/Analysis/PostDominators.cpp
@@ -167,73 +167,6 @@ bool ImmediatePostDominators::runOnFunction(Function &F) {
}
//===----------------------------------------------------------------------===//
-// PostDominatorSet Implementation
-//===----------------------------------------------------------------------===//
-
-static RegisterPass<PostDominatorSet>
-B("postdomset", "Post-Dominator Set Construction", true);
-
-// Postdominator set construction. This converts the specified function to only
-// have a single exit node (return stmt), then calculates the post dominance
-// sets for the function.
-//
-bool PostDominatorSet::runOnFunction(Function &F) {
- // Scan the function looking for the root nodes of the post-dominance
- // relationships. These blocks end with return and unwind instructions.
- // While we are iterating over the function, we also initialize all of the
- // domsets to empty.
- Roots.clear();
- for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
- if (succ_begin(I) == succ_end(I))
- Roots.push_back(I);
-
- // If there are no exit nodes for the function, postdomsets are all empty.
- // This can happen if the function just contains an infinite loop, for
- // example.
- ImmediatePostDominators &IPD = getAnalysis<ImmediatePostDominators>();
- Doms.clear(); // Reset from the last time we were run...
- if (Roots.empty()) return false;
-
- // If we have more than one root, we insert an artificial "null" exit, which
- // has "virtual edges" to each of the real exit nodes.
- //if (Roots.size() > 1)
- // Doms[0].insert(0);
-
- // Root nodes only dominate themselves.
- for (unsigned i = 0, e = Roots.size(); i != e; ++i)
- Doms[Roots[i]].insert(Roots[i]);
-
- // Loop over all of the blocks in the function, calculating dominator sets for
- // each function.
- for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
- if (BasicBlock *IPDom = IPD[I]) { // Get idom if block is reachable
- DomSetType &DS = Doms[I];
- assert(DS.empty() && "PostDomset already filled in for this block?");
- DS.insert(I); // Blocks always dominate themselves
-
- // Insert all dominators into the set...
- while (IPDom) {
- // If we have already computed the dominator sets for our immediate post
- // dominator, just use it instead of walking all the way up to the root.
- DomSetType &IPDS = Doms[IPDom];
- if (!IPDS.empty()) {
- DS.insert(IPDS.begin(), IPDS.end());
- break;
- } else {
- DS.insert(IPDom);
- IPDom = IPD[IPDom];
- }
- }
- } else {
- // Ensure that every basic block has at least an empty set of nodes. This
- // is important for the case when there is unreachable blocks.
- Doms[I];
- }
-
- return false;
-}
-
-//===----------------------------------------------------------------------===//
// PostDominatorTree Implementation
//===----------------------------------------------------------------------===//