[PATCH] D25614: [tablegen] Extract portions of AsmMatcherEmitter for re-use by another generator. NFC.

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 14 06:17:06 PST 2016


dsanders added inline comments.


================
Comment at: utils/TableGen/SubtargetFeatureInfo.cpp:30
+    // Ignore predicates that are not intended for the assembler.
+    if (!Pred->getValueAsBit("AssemblerMatcherPredicate"))
+      continue;
----------------
qcolombet wrote:
> Just a thought, shouldn't this string be an argument?
> Indeed, if we really want to reuse the functionality we shouldn't bake assembler specific stuff in.
> 
> I'm fine with a comment saying that if we want to extend the reusability we would need to pass an additional parameter.
I agree that the name 'AssemblerMatcherPredicate' doesn't make as much sense as it used to but not because of the 'Assembler' part. The new use is still part of an assembler, it just receives the IR directly instead of parsing it from text. The bit that I think may be dubious is the 'Matcher' part because no matching occurs in the new use. At this point, I think it's really a 'MCPredicate' but I'm not convinced it's worth renaming just yet.

I'll add the comment in case someone adds other kinds of predicates in the future.


https://reviews.llvm.org/D25614





More information about the llvm-commits mailing list