[PATCH] D39237: [ARM] Error for invalid shift in memory operand

Oliver Stannard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 07:19:38 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL316441: [ARM] Error for invalid shift in memory operand (authored by olista01).

Changed prior to commit:
  https://reviews.llvm.org/D39237?vs=120060&id=120073#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D39237

Files:
  llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
  llvm/trunk/test/MC/ARM/diagnostics.s


Index: llvm/trunk/test/MC/ARM/diagnostics.s
===================================================================
--- llvm/trunk/test/MC/ARM/diagnostics.s
+++ llvm/trunk/test/MC/ARM/diagnostics.s
@@ -60,6 +60,7 @@
         ldr r4, [r5, r6, ror #-1]
         pld r4, [r5, r6, ror #32]
         pld r4, [r5, r6, rrx #0]
+        ldr r4, [r5, r6, not_a_shift]
 
 @ CHECK-ERRORS: error: shift amount must be an immediate
 @ CHECK-ERRORS:         str r1, [r2, r3, lsl #invalid]
@@ -89,6 +90,8 @@
 @ CHECK-ERRORS:         pld r4, [r5, r6, ror #32]
 @ CHECK-ERRORS: error: ']' expected
 @ CHECK-ERRORS:         pld r4, [r5, r6, rrx #0]
+@ CHECK-ERRORS: error: illegal shift operator
+@ CHECK-ERRORS:         ldr r4, [r5, r6, not_a_shift]
         
         @ Out of range 16-bit immediate on BKPT
         bkpt #65536
Index: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
===================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -5097,7 +5097,7 @@
   SMLoc Loc = Parser.getTok().getLoc();
   const AsmToken &Tok = Parser.getTok();
   if (Tok.isNot(AsmToken::Identifier))
-    return true;
+    return Error(Loc, "illegal shift operator");
   StringRef ShiftName = Tok.getString();
   if (ShiftName == "lsl" || ShiftName == "LSL" ||
       ShiftName == "asl" || ShiftName == "ASL")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39237.120073.patch
Type: text/x-patch
Size: 1406 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171024/4fc2c411/attachment.bin>


More information about the llvm-commits mailing list