[PATCH] D98519: [M68k] Add support for Motorola literal syntax to AsmParser

Ricky Taylor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 2 10:37:56 PDT 2021


ricky26 added inline comments.


================
Comment at: llvm/lib/MC/MCParser/AsmLexer.cpp:36
   AllowAtInIdentifier = !StringRef(MAI.getCommentString()).startswith("@");
+  LexMotorolaIntegers = MAI.shouldUseMotorolaIntegers();
 }
----------------
anirudhp wrote:
> If you're setting this in the constructor, I'm hoping you're aware that for any other invocations of the AsmParser instance, except from llvm-mc, the lexing of motorola integers will not work as "expected", until the `UseMotorolaIntegers` attribute is explicitly set in the Motorola's inherited version of `MCAsmInfo`
> 
> If the only intended invocation is from llvm-mc for now, then maybe it makes sense to remove the MCAsmInfo attribute completely, since you already declared `LexMotorolaIntegers` as `LexMotorolaIntegers = false` in MCAsmLexer.h.
That's about the size of it. I kept it this way so that I can happily build tests for this piece of functionality (which affects more than just the experimental platform) without building for M68k. Then, when the M68k AsmParser implementation lands, it'll include the change to `M68kMCAsmInfo`.

I wanted to keep the `MCAsmInfo` change here to avoid bundling changes into the already quite large bootstrapping of the M68k assembler.

It feels a bit off to populate this in the constructor as I've done, so I'm very much open to alternatives. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98519/new/

https://reviews.llvm.org/D98519



More information about the llvm-commits mailing list