[PATCH] D35315: [Dominators] Make IsPostDominator a template parameter

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 14 00:08:29 PDT 2017


dberlin added a comment.

In https://reviews.llvm.org/D35315#808273, @kuhar wrote:

> In https://reviews.llvm.org/D35315#808241, @dberlin wrote:
>
> > For the cases that are always true, can you just use PostDominatorTree instead?
>
>
> From what I understand, PostDominatorTree lives in lib/Analysis and I'm not sure if I can include it everywhere.
>
> How about we add something like:
>
>   template <typename T> using ForwardDomTreeBase = DominatorTreeBase<T, false>;
>   template <typename T> using PostDomTreeBase = DominatorTreeBase<T, true>;
>
>
> at the bottom of `GenericDominatorTree.h` and use it instead of `DominatorTreeBase<T, true/false>`?


This sounds like a much better idea than a random true/false parameter that has to be documented everywhere :)

I'd probably just call it DomTreeBase and PostDomTreeBase
while correct, I don't think anywhere in our code base refers to forward dominators as anything but dominators :)


https://reviews.llvm.org/D35315





More information about the llvm-commits mailing list