diff options
| author | Owen Anderson <resistor@mac.com> | 2007-09-30 04:17:16 +0000 |
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2007-09-30 04:17:16 +0000 |
| commit | 46ade4eb9b62d20fbada73466300e961ce5cfbf2 (patch) | |
| tree | c85f3eee9a0f763207b1c0dce48944279f961ca9 /llvm/lib/Analysis | |
| parent | bd0079c603d6d282db0890732c1028ca12f1b1e7 (diff) | |
| download | bcm5719-llvm-46ade4eb9b62d20fbada73466300e961ce5cfbf2.tar.gz bcm5719-llvm-46ade4eb9b62d20fbada73466300e961ce5cfbf2.zip | |
Template-ize more of the DomTree internal implementation details. Only the calculate() methods for DomTree and PostDomTree remain to be merged/template-ized.
llvm-svn: 42476
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/PostDominatorCalculation.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/PostDominatorCalculation.h b/llvm/lib/Analysis/PostDominatorCalculation.h index c02bb33928c..5aa692eb37f 100644 --- a/llvm/lib/Analysis/PostDominatorCalculation.h +++ b/llvm/lib/Analysis/PostDominatorCalculation.h @@ -50,7 +50,8 @@ void PDTcalculate(PostDominatorTree& PDT, Function &F) { // Step #2: Calculate the semidominators of all vertices for (succ_iterator SI = succ_begin(W), SE = succ_end(W); SI != SE; ++SI) if (PDT.Info.count(*SI)) { // Only if this predecessor is reachable! - unsigned SemiU = PDT.Info[Eval(PDT, *SI)].Semi; + unsigned SemiU = + PDT.Info[Eval<GraphTraits<Inverse<BasicBlock*> > >(PDT, *SI)].Semi; if (SemiU < WInfo.Semi) WInfo.Semi = SemiU; } @@ -58,14 +59,14 @@ void PDTcalculate(PostDominatorTree& PDT, Function &F) { PDT.Info[PDT.Vertex[WInfo.Semi]].Bucket.push_back(W); BasicBlock *WParent = WInfo.Parent; - Link(PDT, WParent, W, WInfo); + Link<GraphTraits<Inverse<BasicBlock*> > >(PDT, WParent, W, WInfo); // Step #3: Implicitly define the immediate dominator of vertices std::vector<BasicBlock*> &WParentBucket = PDT.Info[WParent].Bucket; while (!WParentBucket.empty()) { BasicBlock *V = WParentBucket.back(); WParentBucket.pop_back(); - BasicBlock *U = Eval(PDT, V); + BasicBlock *U = Eval<GraphTraits<Inverse<BasicBlock*> > >(PDT, V); PDT.IDoms[V] = PDT.Info[U].Semi < PDT.Info[V].Semi ? U : WParent; } } |

