Page MenuHomePhabricator

[TableGen] Allow mnemonics with uppercase letters to be matched

Authored by nlguillemot on Aug 12 2020, 3:43 PM.



The assembly parser "canonicalizes" the mnemonics it processes at an
early level by making them lowercase. The goal of this is presumably to
allow assembly to be case-insensitive. However, if one declares an
instruction with a mnemonic using uppercase letters, then it will
never get matched, since the generated lookup tables for the
AsmMatcherEmitter didn't lower() their inputs. This made it difficult to
have instructions that get printed using a mnemonic that includes
uppercase letters, since they could not be parsed.

To fix this problem, this patch adds a few calls to lower() to make the
lookup tables used in AsmMatcherEmitter be case-insensitive. This allows
instruction mnemonics with uppercase letters to be parsed.

Diff Detail

Event Timeline

nlguillemot created this revision.Aug 12 2020, 3:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2020, 3:43 PM
nlguillemot requested review of this revision.Aug 12 2020, 3:43 PM
This revision is now accepted and ready to land.Aug 14 2020, 10:28 AM