[llvm] r181366 - Fix a bug in the MC asm parser evaluating expressions. It was treating:
Bill Wendling
wendling at apple.com
Tue May 21 16:47:56 PDT 2013
Better late than never! Committed. :-)
-bw
On May 7, 2013, at 2:56 PM, Jim Grosbach <grosbach at apple.com> wrote:
> Nasty bug! Thanks, Kevin.
>
> Bill, this makes sense for 3.3. Approved.
>
> -Jim
>
> On May 7, 2013, at 2:40 PM, Kevin Enderby <enderby at apple.com> wrote:
>
>> Author: enderby
>> Date: Tue May 7 16:40:58 2013
>> New Revision: 181366
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=181366&view=rev
>> Log:
>> Fix a bug in the MC asm parser evaluating expressions. It was treating:
>> A = 9
>> B = 3 * A - 2 * A + 1 as B = 3 * A - (2 * A + 1)
>>
>> rdar://13816516
>>
>> Modified:
>> llvm/trunk/lib/MC/MCParser/AsmParser.cpp
>> llvm/trunk/test/MC/AsmParser/exprs.s
>>
>> Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=181366&r1=181365&r2=181366&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
>> +++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Tue May 7 16:40:58 2013
>> @@ -1092,7 +1092,7 @@ bool AsmParser::ParseBinOpRHS(unsigned P
>> MCBinaryExpr::Opcode Dummy;
>> unsigned NextTokPrec = getBinOpPrecedence(Lexer.getKind(), Dummy);
>> if (TokPrec < NextTokPrec) {
>> - if (ParseBinOpRHS(Precedence+1, RHS, EndLoc)) return true;
>> + if (ParseBinOpRHS(TokPrec+1, RHS, EndLoc)) return true;
>> }
>>
>> // Merge LHS and RHS according to operator.
>>
>> Modified: llvm/trunk/test/MC/AsmParser/exprs.s
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/exprs.s?rev=181366&r1=181365&r2=181366&view=diff
>> ==============================================================================
>> --- llvm/trunk/test/MC/AsmParser/exprs.s (original)
>> +++ llvm/trunk/test/MC/AsmParser/exprs.s Tue May 7 16:40:58 2013
>> @@ -45,6 +45,7 @@ k:
>> check_expr 0 || 0, 0
>> check_expr 1 + 2 < 3 + 4, 1
>> check_expr 1 << 8 - 1, 128
>> + check_expr 3 * 9 - 2 * 9 + 1, 10
>>
>> .set c, 10
>> check_expr c + 1, 11
>>
>>
>> _______________________________________________
>> 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