mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-02 23:26:31 +00:00
MC: Improve expression parsing and implement evaluation of absolute expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74448 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -87,7 +87,7 @@ bool AsmParser::ParseX86Operand(X86Operand &Op) {
|
||||
// $42 -> immediate.
|
||||
Lexer.Lex();
|
||||
int64_t Val;
|
||||
if (ParseExpression(Val))
|
||||
if (ParseAbsoluteExpression(Val))
|
||||
return TokError("expected integer constant");
|
||||
Op = X86Operand::CreateReg(Val);
|
||||
return false;
|
||||
@@ -118,7 +118,7 @@ bool AsmParser::ParseX86MemOperand(X86Operand &Op) {
|
||||
// it.
|
||||
int64_t Disp = 0;
|
||||
if (Lexer.isNot(asmtok::LParen)) {
|
||||
if (ParseExpression(Disp)) return true;
|
||||
if (ParseAbsoluteExpression(Disp)) return true;
|
||||
|
||||
// After parsing the base expression we could either have a parenthesized
|
||||
// memory address or not. If not, return now. If so, eat the (.
|
||||
@@ -139,8 +139,7 @@ bool AsmParser::ParseX86MemOperand(X86Operand &Op) {
|
||||
// memory operand consumed.
|
||||
} else {
|
||||
// It must be an parenthesized expression, parse it now.
|
||||
if (ParseParenExpr(Disp) ||
|
||||
ParseBinOpRHS(1, Disp))
|
||||
if (ParseAbsoluteExpression(Disp))
|
||||
return true;
|
||||
|
||||
// After parsing the base expression we could either have a parenthesized
|
||||
|
Reference in New Issue
Block a user