[PATCH v3] Bug 18833 - ARMAsmParser fails to recognize .req directive alias name in capital letters

Saleem Abdulrasool compnerd at compnerd.org
Mon Feb 17 22:40:24 PST 2014


On Mon, Feb 17, 2014 at 10:01 PM, lin zuojian <manjian2006 at gmail.com> wrote:

> @ Duncan,
> I thought just passing the compilation might be test.But I add CHECK
> comments now
> @Saleem
> > Whilst this is conceptually correct, I dont think it is sufficient.
> This will fix the `.unreq' directive but will not handle the use of the
> alias. Both of them should be addressed simultaneously imo.

I have no idea what other alias problem is.FYI,the req directive
> requires case insensitive names.
>

Actually, given your test case, it seems that the lookup is case
insensitive?  I dont recall the code taking that into account.  Guess I was
mistaken.


> Index: test/MC/ARM/dot-req-capital.s
> ===================================================================
> --- test/MC/ARM/dot-req-capital.s (revision 0)
> +++ test/MC/ARM/dot-req-capital.s (working copy)
> @@ -0,0 +1,20 @@
> +@ RUN: llvm-mc -triple=arm < %s | FileCheck %s
> + .syntax unified
> +_foo:
> +
> + OBJECT .req r2
> + mov r4, OBJECT
> + mov r4, oBjEcT
> + .unreq OBJECT
> +
> +_foo2:
> + OBJECT .req r5
> + mov r4, OBJECT
> + .unreq OBJECT
> +
> +@ CHECK-LABEL: _foo:
> +@ CHECK: mov r4, r2
> +@ CHECK: mov r4, r2
> +
> +@ CHECK-LABEL: _foo2:
> +@ CHECK: mov r4, r5
>

Your change involves the unreq case, but you arent actually testing the
unreq behaviour for case insensitivity.


> Index: lib/Target/ARM/AsmParser/ARMAsmParser.cpp
> ===================================================================
> --- lib/Target/ARM/AsmParser/ARMAsmParser.cpp (revision 201500)
> +++ lib/Target/ARM/AsmParser/ARMAsmParser.cpp (working copy)
> @@ -8243,7 +8243,7 @@
> Error(L, "unexpected input in .unreq directive.");
> return false;
> }
> - RegisterReqs.erase(Parser.getTok().getIdentifier());
> + RegisterReqs.erase(Parser.getTok().getIdentifier().lower());
> Parser.Lex(); // Eat the identifier.
> return false;
> }
>
>
>


-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140217/242ffd00/attachment.html>


More information about the llvm-commits mailing list