[PATCH] D99277: [AsmParser][SystemZ][z/OS] Add in support to accept "#" as part of an Identifier token

Anirudh Prasad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 24 09:36:37 PDT 2021


anirudhp created this revision.
Herald added a subscriber: hiraditya.
anirudhp requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

- This patch adds in support to accept the "#" character as part of an Identifier.
- This support is needed especially for the HLASM dialect since "#" is treated as part of the valid "Alphabet" range
- The way this is done is by making use of the previous precedent set by the `AllowAtInIdentifier` field in `MCAsmLexer.h`. A new field called `AllowHashInIdentifier` is introduced.
- The static function `IsIdentifierChar` is also updated to accept the `#` character if the `AllowHashInIdentifier` field is set to true.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99277

Files:
  llvm/include/llvm/MC/MCParser/MCAsmLexer.h
  llvm/lib/MC/MCParser/AsmLexer.cpp
  llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99277.333021.patch
Type: text/x-patch
Size: 5546 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210324/56d4ec41/attachment.bin>


More information about the llvm-commits mailing list