diff --git a/llvm/include/llvm/MC/MCParser/MCAsmParser.h b/llvm/include/llvm/MC/MCParser/MCAsmParser.h index 601f8f7734b4..d7e3902ac478 100644 --- a/llvm/include/llvm/MC/MCParser/MCAsmParser.h +++ b/llvm/include/llvm/MC/MCParser/MCAsmParser.h @@ -151,13 +151,6 @@ public: virtual bool parseExpression(const MCExpr *&Res, SMLoc &EndLoc) = 0; bool parseExpression(const MCExpr *&Res); - /// parsePrimaryExpr - Parse a primary expression. - /// - /// @param Res - The value of the expression. The result is undefined - /// on error. - /// @result - False on success. - virtual bool parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) = 0; - /// parseParenExpression - Parse an arbitrary expression, assuming that an /// initial '(' has already been consumed. /// diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index c50177cb0a41..14577f79beed 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -221,7 +221,6 @@ public: bool parseExpression(const MCExpr *&Res); virtual bool parseExpression(const MCExpr *&Res, SMLoc &EndLoc); - virtual bool parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc); virtual bool parseParenExpression(const MCExpr *&Res, SMLoc &EndLoc); virtual bool parseAbsoluteExpression(int64_t &Res); @@ -870,10 +869,6 @@ bool AsmParser::parseExpression(const MCExpr *&Res) { return parseExpression(Res, EndLoc); } -bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) { - return ParsePrimaryExpr(Res, EndLoc); -} - const MCExpr * AsmParser::ApplyModifierToExpr(const MCExpr *E, MCSymbolRefExpr::VariantKind Variant) { diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp index 11248bd5d45f..85caa042e32d 100644 --- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -1130,7 +1130,7 @@ X86Operand *X86AsmParser::ParseIntelBracExpression(unsigned SegReg, if (ParseRegister(TmpReg, Start, End)) { const MCExpr *Disp; SMLoc IdentStart = Tok.getLoc(); - if (getParser().parsePrimaryExpr(Disp, End)) + if (getParser().parseExpression(Disp, End)) return 0; if (X86Operand *Err = ParseIntelVarWithQualifier(Disp, IdentStart)) @@ -1182,7 +1182,7 @@ X86Operand *X86AsmParser::ParseIntelBracExpression(unsigned SegReg, SM.onRegister(TmpReg); UpdateLocLex = false; break; - } else if (!getParser().parsePrimaryExpr(Disp, End)) { + } else if (!getParser().parseExpression(Disp, End)) { SM.onDispExpr(); UpdateLocLex = false; break; @@ -1324,7 +1324,7 @@ X86Operand *X86AsmParser::ParseIntelMemOperand(unsigned SegReg, const MCExpr *Disp = 0; SMLoc IdentStart = Tok.getLoc(); - if (getParser().parsePrimaryExpr(Disp, End)) + if (getParser().parseExpression(Disp, End)) return 0; if (!isParsingInlineAsm()) @@ -1401,7 +1401,7 @@ X86Operand *X86AsmParser::ParseIntelOffsetOfOperator(SMLoc Start) { SMLoc End; const MCExpr *Val; - if (getParser().parsePrimaryExpr(Val, End)) + if (getParser().parseExpression(Val, End)) return ErrorOperand(Start, "Unable to parse expression!"); // Don't emit the offset operator. @@ -1437,7 +1437,7 @@ X86Operand *X86AsmParser::ParseIntelOperator(SMLoc Start, unsigned OpKind) { SMLoc End; const MCExpr *Val; - if (getParser().parsePrimaryExpr(Val, End)) + if (getParser().parseExpression(Val, End)) return 0; unsigned Length = 0, Size = 0, Type = 0;