[all-commits] [llvm/llvm-project] 7b921a: [AsmParser][SystemZ][z/OS] Add in support to accep...

Anirudh Prasad via All-commits all-commits at lists.llvm.org
Thu Apr 1 08:25:04 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b921a674756dacebbe0431211ce43edb3493230
      https://github.com/llvm/llvm-project/commit/7b921a674756dacebbe0431211ce43edb3493230
  Author: Anirudh Prasad <anirudh_prasad at hotmail.com>
  Date:   2021-04-01 (Thu, 01 Apr 2021)

  Changed paths:
    M llvm/include/llvm/MC/MCParser/MCAsmLexer.h
    M llvm/lib/MC/MCParser/AsmLexer.cpp
    M llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp

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

- 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.
Note: The field introduced in `MCAsmLexer.h` could very well be moved to `MCAsmInfo.h`. I'm not opposed to it. I decided to put it in `MCAsmLexer` since there seems to be some sort of precedent already with `AllowAtInIdentifier`.

Reviewed By: abhina.sreeskantharajan, nickdesaulniers, MaskRay

Differential Revision: https://reviews.llvm.org/D99277




More information about the All-commits mailing list