[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.

llvm-svn: 321938
This commit is contained in:
Craig Topper 2018-01-06 19:20:32 +00:00
parent ae20590c17
commit ad89541ae9
1 changed files with 6 additions and 0 deletions

View File

@ -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 << " - ";