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)
commit7835e9b232f372e718d6ca5da024ab2819f9a0cb
tree94ac823c53afedabe870dbfd3abc8859478f8390
parent423236bf0b66b18761c917585fef54dc85594761
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.

llvm-svn: 223772
llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/test/MC/ARM/basic-arm-instructions.s