diff options
author | Jakub Kuderski <kubakuderski@gmail.com> | 2017-07-14 18:26:09 +0000 |
---|---|---|
committer | Jakub Kuderski <kubakuderski@gmail.com> | 2017-07-14 18:26:09 +0000 |
commit | b292c22c8de8128b8699dc3247fbf54ee6d49822 (patch) | |
tree | 59ad52f8d1246826cae29c406a4fc4d8c6d4df2a /llvm/lib/CodeGen/MachineDominators.cpp | |
parent | 5b27072f5719fddfde10dba5d8b6365f32ad0356 (diff) | |
download | llvm-b292c22c8de8128b8699dc3247fbf54ee6d49822.zip llvm-b292c22c8de8128b8699dc3247fbf54ee6d49822.tar.gz llvm-b292c22c8de8128b8699dc3247fbf54ee6d49822.tar.bz2 |
[Dominators] Make IsPostDominator a template parameter
Summary:
DominatorTreeBase used to have IsPostDominators (bool) member to indicate if the tree is a dominator or a postdominator tree. This made it possible to switch between the two 'modes' at runtime, but it isn't used in practice anywhere.
This patch makes IsPostDominator a template argument. This way, it is easier to switch between different algorithms at compile-time based on this argument and design external utilities around it. It also makes it impossible to incidentally assign a postdominator tree to a dominator tree (and vice versa), and to further simplify template code in GenericDominatorTreeConstruction.
Reviewers: dberlin, sanjoy, davide, grosser
Reviewed By: dberlin
Subscribers: mzolotukhin, llvm-commits
Differential Revision: https://reviews.llvm.org/D35315
llvm-svn: 308040
Diffstat (limited to 'llvm/lib/CodeGen/MachineDominators.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineDominators.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineDominators.cpp b/llvm/lib/CodeGen/MachineDominators.cpp index 65e9e5d..845e823 100644 --- a/llvm/lib/CodeGen/MachineDominators.cpp +++ b/llvm/lib/CodeGen/MachineDominators.cpp @@ -31,7 +31,7 @@ static cl::opt<bool, true> VerifyMachineDomInfoX( namespace llvm { template class DomTreeNodeBase<MachineBasicBlock>; -template class DominatorTreeBase<MachineBasicBlock>; +template class DominatorTreeBase<MachineBasicBlock, false>; // DomTreeBase } char MachineDominatorTree::ID = 0; @@ -49,7 +49,7 @@ void MachineDominatorTree::getAnalysisUsage(AnalysisUsage &AU) const { bool MachineDominatorTree::runOnMachineFunction(MachineFunction &F) { CriticalEdgesToSplit.clear(); NewBBs.clear(); - DT.reset(new DominatorTreeBase<MachineBasicBlock>(false)); + DT.reset(new DomTreeBase<MachineBasicBlock>()); DT->recalculate(F); return false; } @@ -144,7 +144,7 @@ void MachineDominatorTree::verifyDomTree() const { return; MachineFunction &F = *getRoot()->getParent(); - DominatorTreeBase<MachineBasicBlock> OtherDT(false); + DomTreeBase<MachineBasicBlock> OtherDT; OtherDT.recalculate(F); if (getRootNode()->getBlock() != OtherDT.getRootNode()->getBlock() || DT->compare(OtherDT)) { |