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

Eric Astor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 2 06:20:50 PDT 2021


epastor added a comment.

Can you add tests for this?



================
Comment at: llvm/lib/MC/MCParser/AsmLexer.cpp:424
 
+  // Motorola hex integers: $[0-0a-fA-F]+
+  if (MAI.shouldUseMotorolaIntegers() && CurPtr[-1] == '$') {
----------------
0-9a-fA-F? (Currently reads 0-0)


================
Comment at: llvm/lib/MC/MCParser/AsmLexer.cpp:805
+  case '$':
+    if (MAI.shouldUseMotorolaIntegers() && isDigit(CurPtr[1])) {
+      ++CurPtr;
----------------
I think this only recognizes hex numbers that start with 0-9. Is `$ff` a valid integer literal in this context? If so, this should maybe use `isHexDigit`.


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