[PATCH] D85858: [TableGen] Allow mnemonics with uppercase letters to be matched

Nicolas Guillemot via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 15:43:52 PDT 2020


nlguillemot created this revision.
nlguillemot added a reviewer: dsanders.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
nlguillemot requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85858

Files:
  llvm/test/TableGen/MixedCasedMnemonic.td
  llvm/utils/TableGen/AsmMatcherEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85858.285194.patch
Type: text/x-patch
Size: 4032 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200812/68ec8afe/attachment.bin>


More information about the llvm-commits mailing list