]> granicus.if.org Git - llvm/commit
[Dominators] Make IsPostDominator a template parameter
authorJakub Kuderski <kubakuderski@gmail.com>
Fri, 14 Jul 2017 18:26:09 +0000 (18:26 +0000)
committerJakub Kuderski <kubakuderski@gmail.com>
Fri, 14 Jul 2017 18:26:09 +0000 (18:26 +0000)
commitcb105529db3efec7d2de569f14fb12987f035405
tree7b5d3975e1f2a7127f555a9a547f5c56dc32f51d
parent1356a150afcb05341b624f0eb933752d9020c6c2
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308040 91177308-0d34-0410-b5e6-96231b3b80d8
21 files changed:
include/llvm/Analysis/DominanceFrontier.h
include/llvm/Analysis/DominanceFrontierImpl.h
include/llvm/Analysis/IteratedDominanceFrontier.h
include/llvm/Analysis/LoopInfo.h
include/llvm/Analysis/LoopInfoImpl.h
include/llvm/Analysis/PostDominators.h
include/llvm/CodeGen/MachineDominanceFrontier.h
include/llvm/CodeGen/MachineDominators.h
include/llvm/CodeGen/MachinePostDominators.h
include/llvm/IR/Dominators.h
include/llvm/Support/GenericDomTree.h
lib/Analysis/DominanceFrontier.cpp
lib/Analysis/IteratedDominanceFrontier.cpp
lib/Analysis/LoopInfo.cpp
lib/Analysis/PostDominators.cpp
lib/CodeGen/MachineDominanceFrontier.cpp
lib/CodeGen/MachineDominators.cpp
lib/CodeGen/MachinePostDominators.cpp
lib/IR/Dominators.cpp
lib/Transforms/IPO/SampleProfile.cpp
unittests/IR/DominatorTreeTest.cpp