[PATCH] D28942: [globalisel] Re-factor ISel matchers into a hierarchy. NFC

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 08:26:11 PST 2017


dsanders added a comment.

In https://reviews.llvm.org/D28942#655757, @ab wrote:

> In https://reviews.llvm.org/D28942#653240, @dsanders wrote:
>
> > I should be able to use the same technique as for addPredicate() but it doesn't work. I'm looking into it.
>
>
> Have you figured that out?


Not entirely. I've updated the patch to one that has a workaround that's ok-ish but I don't understand why the version of the code in the `#if 0` block doesn't work. I've have thought that addPredicate() and emitCxxPredicates() would either both work or both fail.



================
Comment at: utils/TableGen/GlobalISelEmitter.cpp:124
+template <class Predicate>
+class WithPredicates {
+private:
----------------
ab wrote:
> The name is cryptic ...but I don't have a better idea  ¯\_(ツ)_/¯
> 
> PredicateList? PredicateVector? PredicateHolder?
I struggled with ideas for the name too. The only reason I went with 'WithPredicates' is because it made the subclass declaration read nicely:
> class OperandMatcher : public WithPredicates<OperandPredicateMatcher>
which defines an matcher with predicates.

I'll have another think on naming.


https://reviews.llvm.org/D28942





More information about the llvm-commits mailing list