[llvm] r204898 - ARM: raise error message when complex SO expressions can't really be
Saleem Abdulrasool
compnerd at compnerd.org
Thu Mar 27 13:24:45 PDT 2014
On Thu, Mar 27, 2014 at 12:42 AM, Jiangning Liu <jiangning.liu at arm.com>wrote:
> Author: jiangning
> Date: Thu Mar 27 02:42:58 2014
> New Revision: 204898
>
> URL: http://llvm.org/viewvc/llvm-project?rev=204898&view=rev
> Log:
> ARM: raise error message when complex SO expressions can't really be
> solved as a constant at compilation time.
>
> Added:
> llvm/trunk/test/MC/ARM/label_offset.s
> Modified:
> llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
>
> Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=204898&r1=204897&r2=204898&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Thu Mar 27
> 02:42:58 2014
> @@ -9357,7 +9357,7 @@ unsigned ARMAsmParser::validateTargetOpe
> const MCExpr *SOExpr = Op->getImm();
> int64_t Value;
> if (!SOExpr->EvaluateAsAbsolute(Value))
> - return Match_Success;
> + return Match_InvalidOperand;
> assert((Value >= INT32_MIN && Value <= INT32_MAX) &&
> "expression value must be representiable in 32 bits");
> }
>
Why not drop the case entirely?
You are returning Match_InvalidOperand in all cases now.
> Added: llvm/trunk/test/MC/ARM/label_offset.s
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/label_offset.s?rev=204898&view=auto
>
> ==============================================================================
> --- llvm/trunk/test/MC/ARM/label_offset.s (added)
> +++ llvm/trunk/test/MC/ARM/label_offset.s Thu Mar 27 02:42:58 2014
> @@ -0,0 +1,8 @@
> +@ RUN: not llvm-mc -triple=armv7-linux-gnuabi -filetype=obj < %s 2>&1 |
> FileCheck %s
> +
> +.text
> + cmp r2, #(l2 - l1) >> 6
> +@ CHECK: error: invalid operand for instruction
> +
> +l1:
> +l2:
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
--
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140327/b0a15548/attachment.html>
More information about the llvm-commits
mailing list