ARM accept an immediate offset in memory operands w/o the '#'.
authorJim Grosbach <grosbach@apple.com>
Tue, 15 Nov 2011 22:14:41 +0000 (22:14 +0000)
committerJim Grosbach <grosbach@apple.com>
Tue, 15 Nov 2011 22:14:41 +0000 (22:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144709 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmParser/ARMAsmParser.cpp

index 1535a7a77683c68b1a7f68a1be69e9d29089955b..ede71da5757c591bd6b6e895b7a781117729ca73 100644 (file)
@@ -3559,9 +3559,12 @@ parseMemory(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
   }
 
   // If we have a '#', it's an immediate offset, else assume it's a register
-  // offset.
-  if (Parser.getTok().is(AsmToken::Hash)) {
-    Parser.Lex(); // Eat the '#'.
+  // offset. Be friendly and also accept a plain integer (without a leading
+  // hash) for gas compatibility.
+  if (Parser.getTok().is(AsmToken::Hash) ||
+      Parser.getTok().is(AsmToken::Integer)) {
+    if (Parser.getTok().is(AsmToken::Hash))
+      Parser.Lex(); // Eat the '#'.
     E = Parser.getTok().getLoc();
 
     bool isNegative = getParser().getTok().is(AsmToken::Minus);