PR18931, PATCH: Crash using integrated assembler with immediate arithmetic

Stepan Dyatkovskiy stpworld at narod.ru
Tue Mar 25 21:46:22 PDT 2014


Hi Rafael,

 > Can you expand it a bit For example:
 >
 > // CHECK: cmp r2, #1
Fixed.

 > You can probably just use
 >
 > if (MO.isExpr()) {
Fixed.

-Stepan

Rafael EspĂ­ndola wrote:
> The test should be in MC, not CodeGen.
>
> + // CHECK: #1
>
>
> Can you expand it a bit For example:
>
> // CHECK: cmp r2, #1
>
>
> +    // We expect MO to be immediate,
>
> The comment is not exactly right with the patch. We expect it to be an
> expression or an immediate.
>
> +    if (!MO.isImm()) {
> +      assert(MO.isExpr() && "Unexpected operand type!");
>
> You can probably just use
>
> if (MO.isExpr()) {
>
> the "MO.getImm();" afterwards takes care of the assert that we only
> have expressions or immediates.
>
> Cheers,
> Rafael
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr18931-2014-03-26.patch
Type: text/x-diff
Size: 1687 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140326/a070c1a9/attachment.patch>


More information about the llvm-commits mailing list