Fix modified immediate bug reported by MC Hammer.
authorAsiri Rathnayake <asiri.rathnayake@arm.com>
Tue, 9 Dec 2014 13:14:58 +0000 (13:14 +0000)
committerAsiri Rathnayake <asiri.rathnayake@arm.com>
Tue, 9 Dec 2014 13:14:58 +0000 (13:14 +0000)
commit838ec33e0c7aac35905e4e008d3448ad6f5e087b
tree4afd592f86fe99be371655056b8c97906a3d17f8
parent85bb610daff882e06a4e9f6c3f2f9fd7773161c5
Fix modified immediate bug reported by MC Hammer.

Instructions of the form [ADD Rd, pc, #imm] are manually aliased
in processInstruction() to use ADR. To accomodate this, mod_imm handling
had to be tweaked a bit. Turns out it was the manual aliasing that must
be tweaked to accommodate mod_imms instead. More information about the
parsed instruction is available at the point where processInstruction()
is invoked, which makes it easier to detect a mod_imm at that point rather
than trying to detect a potential alias when a mod_imm is being prepped.
Added a test case and fixed some white spaces as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223772 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
test/MC/ARM/basic-arm-instructions.s