This is an archive of the discontinued LLVM Phabricator instance.

[mips] Process numeric register name in the .set assignment directive
ClosedPublic

Authored by atanasyan on May 29 2018, 3:00 AM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan created this revision.May 29 2018, 3:00 AM
This revision is now accepted and ready to land.May 29 2018, 8:26 AM

Thanks for review.

This revision was automatically updated to reflect the committed changes.