Commit a0eee6c9 authored by Ilya Leoshkevich's avatar Ilya Leoshkevich
Browse files

[SystemZ] Allow symbols in immediate asm operands

Currently mentioning any symbols in immediate asm operands is not
supported, for example:

    error: invalid operand for instruction
    lghi %r4,foo_end-foo

The immediate problem is that is*Imm() and print*Operand() functions do
not accept MCExprs, but simply relaxing these checks is not enough:
after symbol addresses are computed, range checks need to run against
resolved values.

Add a number of SystemZ::FixupKind members for each kind of immediate
value and process them in SystemZMCAsmBackend::applyFixup(). Only
perform the range checks, do not change anything.

Adjust the tests: move previously failing cases like the one shown
above out of insn-bad.s.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D154899
parent e6c62a2d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment