Fix for pr18931: Crash using integrated assembler with immediate arithmetic
authorStepan Dyatkovskiy <stpworld@narod.ru>
Thu, 27 Mar 2014 07:49:39 +0000 (07:49 +0000)
committerStepan Dyatkovskiy <stpworld@narod.ru>
Thu, 27 Mar 2014 07:49:39 +0000 (07:49 +0000)
commitfccc6901d691ff4f0bf7ef8e15796863fd5c9efd
treed581686e2060530e32b6b422b14b202e71a595b7
parent09b4588309f5ed1900d36633668933569247c20f
Fix for pr18931: 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@204899 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
test/MC/ARM/cmp-immediate-fixup.s [new file with mode: 0644]