[PATCH] D47464: [mips] Process numeric register name in the .set assignment directive

Simon Atanasyan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 29 03:00:32 PDT 2018


atanasyan created this revision.
atanasyan added a reviewer: sdardis.
Herald added a subscriber: arichardson.

Now LLVM assembler cannot process the following code and generates an error. GNU tools support .set assignment directive with numeric register name.

  .set r4, 4
  
  test.s:1:11: error: invalid token in expression
    .set r4, $4
             ^

This patch teach assembler to handle such directives correctly. Unfortunately a numeric register name cannot be represented as an expression. That's why we have to maintain a separate `StringMap` in the `MipsAsmParser` to keep mapping between aliases names and register numbers.


Repository:
  rL LLVM

https://reviews.llvm.org/D47464

Files:
  lib/Target/Mips/AsmParser/MipsAsmParser.cpp
  test/MC/Mips/mips_directives.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47464.148867.patch
Type: text/x-patch
Size: 4713 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180529/0914f40e/attachment.bin>


More information about the llvm-commits mailing list