[PATCH] D101732: [M68k][AsmParser] Support negative integer constants

Min-Yih Hsu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 2 21:23:20 PDT 2021


myhsu marked an inline comment as done.
myhsu added inline comments.


================
Comment at: llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp:590
+  case AsmToken::Minus:
+    return getLexer().peekTok().getKind() == AsmToken::Integer;
 
----------------
ricky26 wrote:
> nit: Is this totally necessary? I don't think `-` can appear at the start of anything else apart from possibly an identifier (which is parsed by `parseExpression` anyway).
> 
> This doesn't make much difference though (but could preserve const).
Minus sign can be in front of a pre-decrement memory operand. Although currently `isExpr` is only used by one function (`parseMemOp`) in which all usages of `isExpr` are carefully placed such that they will never be confused with pre-decrement operand. But to prevent potential misuse in the future I prefer `isExpr` to be more explicit.


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

https://reviews.llvm.org/D101732



More information about the llvm-commits mailing list