[PATCH] [ARM64] Correct more bounds checks/diagnostics for arithmetic shift operands

Tim Northover t.p.northover at gmail.com
Fri May 9 11:17:02 PDT 2014

Hi Bradley,

I've got one question about this one:

Comment at: lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp:2476-2478
@@ -2468,3 +2475,5 @@
+  // diagnostics rather than ones different from out of range 32-bit shifts.
   if ((MCE->getValue() & 0x3f) != MCE->getValue()) {
-    Error(ExprLoc, "immediate value too large for shifter operand");
-    return MatchOperand_ParseFail;
+    Operands.push_back(ARM64Operand::CreateShifter(ARM64_AM::InvalidShift, 0, S,
+                                                   E, getContext()));
+  } else {
What goes wrong if we just add the shift and let the isXYZ methods take care of it? It seems like it might be more consistent way to handle things in general.


More information about the llvm-commits mailing list