Recommitted fix for PR18931, with extended tests set.
authorStepan Dyatkovskiy <stpworld@narod.ru>
Sat, 29 Mar 2014 13:12:40 +0000 (13:12 +0000)
committerStepan Dyatkovskiy <stpworld@narod.ru>
Sat, 29 Mar 2014 13:12:40 +0000 (13:12 +0000)
commit3fed2f133ce05fb7ae7079ecdf979f8e3b2fb210
tree301b74763066021475352f71e50d62a53ad5b3ef
parent9f36b6632420ab9b0d6c208e82e4c3c1217ec0ea
Recommitted fix for PR18931, with extended tests set.
Issue subject: Crash using integrated assembler with immediate arithmetic

Fix description:
Expressions like 'cmp r0, #(l1 - l2) >> 3' could not be evaluated on asm parsing stage,
since it is impossible to resolve labels on this stage. In the end of stage we still have
expression (MCExpr).
Then, when we want to encode it, we expect it to be an immediate, but it still an expression.
Patch introduces a Fixup (MCFixup instance), that is processed after main encoding stage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205094 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
test/MC/ARM/cmp-immediate-fixup-error.s [new file with mode: 0644]
test/MC/ARM/cmp-immediate-fixup-error2.s [new file with mode: 0644]
test/MC/ARM/cmp-immediate-fixup.s [new file with mode: 0644]
test/MC/ARM/cmp-immediate-fixup2.s [new file with mode: 0644]
test/MC/ARM/label_offset.s [deleted file]