summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-09-19 18:42:21 +0000
committerJim Grosbach <grosbach@apple.com>2011-09-19 18:42:21 +0000
commitfb12f35545481e8b42bd547bc37d220ffee77f86 (patch)
tree1974cbfb50c828db32f08cfedbb09c99cb257254
parentd9746fe58ace4a8625983da1ecf68c0564883616 (diff)
downloadllvm-fb12f35545481e8b42bd547bc37d220ffee77f86.tar.gz
llvm-fb12f35545481e8b42bd547bc37d220ffee77f86.tar.bz2
llvm-fb12f35545481e8b42bd547bc37d220ffee77f86.tar.xz
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
-rw-r--r--lib/Target/ARM/AsmParser/ARMAsmParser.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 30bed29949..7646c5c31c 100644
--- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -2807,6 +2807,13 @@ parseMemory(SmallVectorImpl<MCParsedAsmOperand*> &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;
}