[llvm] r194570 - Fix bug in .gpword directive parsing.
Eric Christopher
echristo at gmail.com
Wed Nov 13 14:19:31 PST 2013
On Wed, Nov 13, 2013 at 5:18 AM, Vladimir Medic
<Vladimir.Medic at imgtec.com> wrote:
> Author: vmedic
> Date: Wed Nov 13 07:18:04 2013
> New Revision: 194570
>
> URL: http://llvm.org/viewvc/llvm-project?rev=194570&view=rev
> Log:
> Fix bug in .gpword directive parsing.
>
This is a really bad commit message and the lack of comments in the
change or the testcase makes review after commit nearly impossible
here. Please elaborate on what's going on here for this patch and in
the future.
Thanks
-eric
> Modified:
> llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
> llvm/trunk/test/MC/Mips/mips_directives.s
>
> Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=194570&r1=194569&r2=194570&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
> +++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Wed Nov 13 07:18:04 2013
> @@ -2379,13 +2379,11 @@ bool MipsAsmParser::parseDirectiveGpWord
> // method to evaluate the expression.
> if (getParser().parseExpression(Value))
> return true;
> -
> getParser().getStreamer().EmitGPRel32Value(Value);
> - Parser.Lex(); // Eat last token.
>
> - if (getLexer().is(AsmToken::EndOfStatement))
> + if (getLexer().isNot(AsmToken::EndOfStatement))
> return Error(getLexer().getLoc(), "unexpected token in directive");
> -
> + Parser.Lex(); // Eat EndOfStatement token.
> return false;
> }
>
>
> Modified: llvm/trunk/test/MC/Mips/mips_directives.s
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips_directives.s?rev=194570&r1=194569&r2=194570&view=diff
> ==============================================================================
> --- llvm/trunk/test/MC/Mips/mips_directives.s (original)
> +++ llvm/trunk/test/MC/Mips/mips_directives.s Wed Nov 13 07:18:04 2013
> @@ -19,10 +19,11 @@ $BB0_2:
> .set noat
> $JTI0_0:
> .gpword ($BB0_2)
> +
> .word 0x77fffffc
> # CHECK: $JTI0_0:
> # CHECK: .gpword ($BB0_2)
> -# CHECK-NEXT: .4byte 2013265916
> +# CHECK: .4byte 2013265916
> .set at=$12
> .set macro
> # CHECK: b 1332 # encoding: [0x10,0x00,0x01,0x4d]
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list