Displaying 6 results from an estimated 6 matches for "parsebinoprhs".
2013 May 03
2
[LLVMdev] bug report on MC asm parser evaluating expressions
...9
B = 3*A - 2 * A + 1
the value of B should be 10 instead of 8.
It seems asm parser treat "B = 3*A - 2 * A + 1" as "B = 3*A - (2 * A + 1)"
because the second "*" has higher precedence than "-", and evaluation just
performs simple recursion within AsmParser::ParseBinOpRHS (which resides in
file lib/MC/MCParser/AsmParser.cpp).
Can some one make a fixup?
Regard.
--
杨勇勇 (Yang Yong-Yong)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130503/0325d37c/attachment.html>
2013 May 03
0
[LLVMdev] bug report on MC asm parser evaluating expressions
...gt; the value of B should be 10 instead of 8.
>
> It seems asm parser treat "B = 3*A - 2 * A + 1" as "B = 3*A - (2 * A + 1)"
> because the second "*" has higher precedence than "-", and evaluation just
> performs simple recursion within AsmParser::ParseBinOpRHS (which resides in
> file lib/MC/MCParser/AsmParser.cpp).
>
> Can some one make a fixup?
This is a horrible bug :-(
Can you please report it in llvm.org/bugs?
Thanks,
Rafael
2010 Feb 17
2
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...t: return Error("unknown token when expecting an expression");
case tok_identifier: return ParseIdentifierExpr();
case tok_number: return ParseNumberExpr();
case '(': return ParseParenExpr();
}
}
/// binoprhs
/// ::= ('+' primary)*
static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
// If this is a binop, find its precedence.
while (1) {
int TokPrec = GetTokPrecedence();
// If this is a binop that binds at least as tightly as the current binop,
// consume it, otherwise we are done.
if (TokPrec < ExprPrec)
return LHS;...
2010 Feb 17
0
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...expecting an expression");
> case tok_identifier: return ParseIdentifierExpr();
> case tok_number: return ParseNumberExpr();
> case '(': return ParseParenExpr();
> }
> }
>
> /// binoprhs
> /// ::= ('+' primary)*
> static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
> // If this is a binop, find its precedence.
> while (1) {
> int TokPrec = GetTokPrecedence();
>
> // If this is a binop that binds at least as tightly as the current
> binop,
> // consume it, otherwise we are done.
> if (TokPrec...
2010 Feb 17
1
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...;> case tok_identifier: return ParseIdentifierExpr();
>> case tok_number: return ParseNumberExpr();
>> case '(': return ParseParenExpr();
>> }
>> }
>>
>> /// binoprhs
>> /// ::= ('+' primary)*
>> static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
>> // If this is a binop, find its precedence.
>> while (1) {
>> int TokPrec = GetTokPrecedence();
>>
>> // If this is a binop that binds at least as tightly as the current
>> binop,
>> // consume it, otherwise we ar...
2010 Jun 21
2
[LLVMdev] MC: Object file specific parsing
....
+ bool ParseIdentifier(StringRef &Res);
+
MCSymbol *CreateSymbol(StringRef Name);
+private:
bool ParseStatement();
-
- bool TokError(const char *Msg);
void PrintMessage(SMLoc Loc, const std::string &Msg, const char *Type) const;
@@ -110,15 +121,7 @@ private:
bool ParseBinOpRHS(unsigned Precedence, const MCExpr *&Res, SMLoc &EndLoc);
bool ParseParenExpr(const MCExpr *&Res, SMLoc &EndLoc);
- /// ParseIdentifier - Parse an identifier or string (as a quoted identifier)
- /// and set \arg Res to the identifier contents.
- bool ParseIdentifier(StringRef...