This is an archive of the discontinued LLVM Phabricator instance.

[AsmParser] Add DiagnosticString to AsmOperands in tablegen
ClosedPublic

Authored by olista01 on Apr 3 2017, 9:58 AM.

Details

Summary

This adds a DiagnosticString member to the AsmOperand tablegen class, so
that the diagnostic text to be used when an assembly operand is
incorrect can be stored in the tablegen description of the operand,
rather than in a separate switch statement in the AsmParser.

If DiagnosticString is used for any operands, tablegen will emit a
getMatchKindDiag function, to map from diagnostic enums to strings

Diff Detail

Repository
rL LLVM

Event Timeline

olista01 created this revision.Apr 3 2017, 9:58 AM
rengolin accepted this revision.Apr 4 2017, 9:15 AM

Used by D31607, tested there. LGTM. Thanks!

This revision is now accepted and ready to land.Apr 4 2017, 9:15 AM
This revision was automatically updated to reflect the committed changes.