[llvm] r321938 - [TableGen] Make the ambiguous match debug messages from the AsmMatcherEmitter slightly more useful.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 6 11:20:32 PST 2018


Author: ctopper
Date: Sat Jan  6 11:20:32 2018
New Revision: 321938

URL: http://llvm.org/viewvc/llvm-project?rev=321938&view=rev
Log:
[TableGen] Make the ambiguous match debug messages from the AsmMatcherEmitter slightly more useful.

Don't report ambiguous matches on different variants. Print the variant number in the output.

Modified:
    llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp

Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=321938&r1=321937&r2=321938&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Sat Jan  6 11:20:32 2018
@@ -620,6 +620,10 @@ struct MatchableInfo {
     if (Mnemonic != RHS.Mnemonic)
       return false;
 
+    // Different variants can't conflict.
+    if (AsmVariantID != RHS.AsmVariantID)
+      return false;
+
     // The number of operands is unambiguous.
     if (AsmOperands.size() != RHS.AsmOperands.size())
       return false;
@@ -770,6 +774,8 @@ public:
 LLVM_DUMP_METHOD void MatchableInfo::dump() const {
   errs() << TheDef->getName() << " -- " << "flattened:\"" << AsmString <<"\"\n";
 
+  errs() << "  variant: " << AsmVariantID << "\n";
+
   for (unsigned i = 0, e = AsmOperands.size(); i != e; ++i) {
     const AsmOperand &Op = AsmOperands[i];
     errs() << "  op[" << i << "] = " << Op.Class->ClassName << " - ";




More information about the llvm-commits mailing list