From fb12f35545481e8b42bd547bc37d220ffee77f86 Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Mon, 19 Sep 2011 18:42:21 +0000 Subject: [PATCH] ARM asm parsing should handle pre-indexed writeback w/o immediate. For example, 'ldrb r9, [sp]!' is odd, but valid. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140035 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 30bed29949c..7646c5c31ca 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -2807,6 +2807,13 @@ parseMemory(SmallVectorImpl &Operands) { Operands.push_back(ARMOperand::CreateMem(BaseRegNum, 0, 0, ARM_AM::no_shift, 0, false, S, E)); + // If there's a pre-indexing writeback marker, '!', just add it as a token + // operand. It's rather odd, but syntactically valid. + if (Parser.getTok().is(AsmToken::Exclaim)) { + Operands.push_back(ARMOperand::CreateToken("!",Parser.getTok().getLoc())); + Parser.Lex(); // Eat the '!'. + } + return false; } -- 2.34.1