[AArch64] Attempt to parse more operands as expressions
authorDavid Green <david.green@arm.com>
Tue, 18 Sep 2018 09:44:53 +0000 (09:44 +0000)
committerDavid Green <david.green@arm.com>
Tue, 18 Sep 2018 09:44:53 +0000 (09:44 +0000)
commit85d6a5599509fef8f2b5fe72f4ee23187d65c68e
tree0f493dca96c224fd8f1296b0633995c7a3950cd5
parent4c077f987c6725012fa47730e9aeba513ea4acb5
[AArch64] Attempt to parse more operands as expressions

This tries to make use of evaluateAsRelocatable in AArch64AsmParser::classifySymbolRef
to parse more complex expressions as relocatable operands. It is hopefully better than
the existing code which only handles Symbol +- Constant.

This allows us to parse more complex adr/adrp, mov, ldr/str and add operands. It also
loosens the requirements on parsing addends in ld/st and mov's and adds a number of
tests.

Differential Revision: https://reviews.llvm.org/D51792

llvm-svn: 342455
llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
llvm/test/MC/AArch64/adr-diagnostics.s [new file with mode: 0644]
llvm/test/MC/AArch64/adr.s [new file with mode: 0644]
llvm/test/MC/AArch64/arm64-elf-relocs.s
llvm/test/MC/AArch64/basic-a64-diagnostics.s
llvm/test/MC/AArch64/elf-reloc-movw.s
llvm/test/MC/AArch64/label-arithmetic-elf.s