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/IR/Dominators.cpp | |
parent | 5b27072f5719fddfde10dba5d8b6365f32ad0356 (diff) | |
download | bcm5719-llvm-b292c22c8de8128b8699dc3247fbf54ee6d49822.tar.gz bcm5719-llvm-b292c22c8de8128b8699dc3247fbf54ee6d49822.zip |
[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/IR/Dominators.cpp')
-rw-r--r-- | llvm/lib/IR/Dominators.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/IR/Dominators.cpp b/llvm/lib/IR/Dominators.cpp index a76f9e9d04c..df475283609 100644 --- a/llvm/lib/IR/Dominators.cpp +++ b/llvm/lib/IR/Dominators.cpp @@ -61,14 +61,20 @@ bool BasicBlockEdge::isSingleEdge() const { //===----------------------------------------------------------------------===// template class llvm::DomTreeNodeBase<BasicBlock>; -template class llvm::DominatorTreeBase<BasicBlock>; +template class llvm::DominatorTreeBase<BasicBlock, false>; // DomTreeBase +template class llvm::DominatorTreeBase<BasicBlock, true>; // PostDomTreeBase template void llvm::DomTreeBuilder::Calculate<DomTreeBuilder::BBDomTree, Function>( DomTreeBuilder::BBDomTree &DT, Function &F); +template void +llvm::DomTreeBuilder::Calculate<DomTreeBuilder::BBPostDomTree, Function>( + DomTreeBuilder::BBPostDomTree &DT, Function &F); template bool llvm::DomTreeBuilder::Verify<DomTreeBuilder::BBDomTree>( const DomTreeBuilder::BBDomTree &DT); +template bool llvm::DomTreeBuilder::Verify<DomTreeBuilder::BBPostDomTree>( + const DomTreeBuilder::BBPostDomTree &DT); bool DominatorTree::invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &) { |