[PATCH] D73176: [ARM] Fix dropped dollar sign from symbols in branch targets

Lucas Prates via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 08:01:22 PST 2020


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


================
Comment at: llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp:6051
+    // $42 -> immediate
+    // $foo -> symbol name
     S = Parser.getTok().getLoc();
----------------
pratlucas wrote:
> chill wrote:
> > What if we have here  `$ foo`, i.e. whitespace after the dollar? We should not paste together two separate tokens `$` and `<whatever>` to form an identifier,  `$foo`, `$12` are identifiers, but `$ 12` is not.
> > 
> > 
> From what I've checked, `parseExpression(...)` takes care of this scenario:
> ```
> <stdin>:36:11: error: invalid token in expression
>         b $ foo
>           ^
> ```
> The change is not binding the two actual tokens together, but only refraining from removing the $ token from the expression.
> Please let me know if you believe a more active handling of this scenario is necessary.
Checking the behavior without the changes from the patch, expressions like `b $ foo` are currently accepted by the parser with no errors, as the $ token is dropped from the expression.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73176





More information about the llvm-commits mailing list