mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-02 05:12:20 +00:00
MCParser: Update method names per coding guidelines.
s/AddDirectiveHandler/addDirectiveHandler/ s/ParseMSInlineAsm/parseMSInlineAsm/ s/ParseIdentifier/parseIdentifier/ s/ParseStringToEndOfStatement/parseStringToEndOfStatement/ s/ParseEscapedString/parseEscapedString/ s/EatToEndOfStatement/eatToEndOfStatement/ s/ParseExpression/parseExpression/ s/ParseParenExpression/parseParenExpression/ s/ParseAbsoluteExpression/parseAbsoluteExpression/ s/CheckForValidSection/checkForValidSection/ http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175675 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6189288766
commit
cb2ae3d98e
@ -65,7 +65,7 @@ protected: // Can only create subclasses.
|
||||
public:
|
||||
virtual ~MCAsmParser();
|
||||
|
||||
virtual void AddDirectiveHandler(StringRef Directive,
|
||||
virtual void addDirectiveHandler(StringRef Directive,
|
||||
ExtensionDirectiveHandler Handler) = 0;
|
||||
|
||||
virtual SourceMgr &getSourceManager() = 0;
|
||||
@ -92,8 +92,8 @@ public:
|
||||
virtual void setParsingInlineAsm(bool V) = 0;
|
||||
virtual bool isParsingInlineAsm() = 0;
|
||||
|
||||
/// ParseMSInlineAsm - Parse ms-style inline assembly.
|
||||
virtual bool ParseMSInlineAsm(void *AsmLoc, std::string &AsmString,
|
||||
/// parseMSInlineAsm - Parse ms-style inline assembly.
|
||||
virtual bool parseMSInlineAsm(void *AsmLoc, std::string &AsmString,
|
||||
unsigned &NumOutputs, unsigned &NumInputs,
|
||||
SmallVectorImpl<std::pair<void *, bool> > &OpDecls,
|
||||
SmallVectorImpl<std::string> &Constraints,
|
||||
@ -126,50 +126,50 @@ public:
|
||||
bool TokError(const Twine &Msg,
|
||||
ArrayRef<SMRange> Ranges = ArrayRef<SMRange>());
|
||||
|
||||
/// ParseIdentifier - Parse an identifier or string (as a quoted identifier)
|
||||
/// parseIdentifier - Parse an identifier or string (as a quoted identifier)
|
||||
/// and set \p Res to the identifier contents.
|
||||
virtual bool ParseIdentifier(StringRef &Res) = 0;
|
||||
virtual bool parseIdentifier(StringRef &Res) = 0;
|
||||
|
||||
/// \brief Parse up to the end of statement and return the contents from the
|
||||
/// current token until the end of the statement; the current token on exit
|
||||
/// will be either the EndOfStatement or EOF.
|
||||
virtual StringRef ParseStringToEndOfStatement() = 0;
|
||||
virtual StringRef parseStringToEndOfStatement() = 0;
|
||||
|
||||
/// ParseEscapedString - Parse the current token as a string which may include
|
||||
/// parseEscapedString - Parse the current token as a string which may include
|
||||
/// escaped characters and return the string contents.
|
||||
virtual bool ParseEscapedString(std::string &Data) = 0;
|
||||
virtual bool parseEscapedString(std::string &Data) = 0;
|
||||
|
||||
/// EatToEndOfStatement - Skip to the end of the current statement, for error
|
||||
/// eatToEndOfStatement - Skip to the end of the current statement, for error
|
||||
/// recovery.
|
||||
virtual void EatToEndOfStatement() = 0;
|
||||
virtual void eatToEndOfStatement() = 0;
|
||||
|
||||
/// ParseExpression - Parse an arbitrary expression.
|
||||
/// parseExpression - Parse an arbitrary expression.
|
||||
///
|
||||
/// @param Res - The value of the expression. The result is undefined
|
||||
/// on error.
|
||||
/// @result - False on success.
|
||||
virtual bool ParseExpression(const MCExpr *&Res, SMLoc &EndLoc) = 0;
|
||||
bool ParseExpression(const MCExpr *&Res);
|
||||
virtual bool parseExpression(const MCExpr *&Res, SMLoc &EndLoc) = 0;
|
||||
bool parseExpression(const MCExpr *&Res);
|
||||
|
||||
/// ParseParenExpression - Parse an arbitrary expression, assuming that an
|
||||
/// parseParenExpression - Parse an arbitrary expression, assuming that an
|
||||
/// initial '(' has already been consumed.
|
||||
///
|
||||
/// @param Res - The value of the expression. The result is undefined
|
||||
/// on error.
|
||||
/// @result - False on success.
|
||||
virtual bool ParseParenExpression(const MCExpr *&Res, SMLoc &EndLoc) = 0;
|
||||
virtual bool parseParenExpression(const MCExpr *&Res, SMLoc &EndLoc) = 0;
|
||||
|
||||
/// ParseAbsoluteExpression - Parse an expression which must evaluate to an
|
||||
/// parseAbsoluteExpression - Parse an expression which must evaluate to an
|
||||
/// absolute value.
|
||||
///
|
||||
/// @param Res - The value of the absolute expression. The result is undefined
|
||||
/// on error.
|
||||
/// @result - False on success.
|
||||
virtual bool ParseAbsoluteExpression(int64_t &Res) = 0;
|
||||
virtual bool parseAbsoluteExpression(int64_t &Res) = 0;
|
||||
|
||||
/// CheckForValidSection - Ensure that we have a valid section set in the
|
||||
/// checkForValidSection - Ensure that we have a valid section set in the
|
||||
/// streamer. Otherwise, report an error and switch to .text.
|
||||
virtual void CheckForValidSection() = 0;
|
||||
virtual void checkForValidSection() = 0;
|
||||
};
|
||||
|
||||
/// \brief Create an MCAsmParser instance.
|
||||
|
@ -140,7 +140,7 @@ private:
|
||||
|
||||
/// ExtensionDirectiveMap - maps directive names to handler methods in parser
|
||||
/// extensions. Extensions register themselves in this map by calling
|
||||
/// AddDirectiveHandler.
|
||||
/// addDirectiveHandler.
|
||||
StringMap<ExtensionDirectiveHandler> ExtensionDirectiveMap;
|
||||
|
||||
/// MacroMap - Map of currently defined macros.
|
||||
@ -177,7 +177,7 @@ public:
|
||||
|
||||
virtual bool Run(bool NoInitialTextSection, bool NoFinalize = false);
|
||||
|
||||
virtual void AddDirectiveHandler(StringRef Directive,
|
||||
virtual void addDirectiveHandler(StringRef Directive,
|
||||
ExtensionDirectiveHandler Handler) {
|
||||
ExtensionDirectiveMap[Directive] = Handler;
|
||||
}
|
||||
@ -210,7 +210,7 @@ public:
|
||||
void setParsingInlineAsm(bool V) { ParsingInlineAsm = V; }
|
||||
bool isParsingInlineAsm() { return ParsingInlineAsm; }
|
||||
|
||||
bool ParseMSInlineAsm(void *AsmLoc, std::string &AsmString,
|
||||
bool parseMSInlineAsm(void *AsmLoc, std::string &AsmString,
|
||||
unsigned &NumOutputs, unsigned &NumInputs,
|
||||
SmallVectorImpl<std::pair<void *,bool> > &OpDecls,
|
||||
SmallVectorImpl<std::string> &Constraints,
|
||||
@ -219,17 +219,17 @@ public:
|
||||
const MCInstPrinter *IP,
|
||||
MCAsmParserSemaCallback &SI);
|
||||
|
||||
bool ParseExpression(const MCExpr *&Res);
|
||||
virtual bool ParseExpression(const MCExpr *&Res, SMLoc &EndLoc);
|
||||
virtual bool ParseParenExpression(const MCExpr *&Res, SMLoc &EndLoc);
|
||||
virtual bool ParseAbsoluteExpression(int64_t &Res);
|
||||
bool parseExpression(const MCExpr *&Res);
|
||||
virtual bool parseExpression(const MCExpr *&Res, SMLoc &EndLoc);
|
||||
virtual bool parseParenExpression(const MCExpr *&Res, SMLoc &EndLoc);
|
||||
virtual bool parseAbsoluteExpression(int64_t &Res);
|
||||
|
||||
/// ParseIdentifier - Parse an identifier or string (as a quoted identifier)
|
||||
/// parseIdentifier - Parse an identifier or string (as a quoted identifier)
|
||||
/// and set \p Res to the identifier contents.
|
||||
virtual bool ParseIdentifier(StringRef &Res);
|
||||
virtual void EatToEndOfStatement();
|
||||
virtual bool parseIdentifier(StringRef &Res);
|
||||
virtual void eatToEndOfStatement();
|
||||
|
||||
virtual void CheckForValidSection();
|
||||
virtual void checkForValidSection();
|
||||
/// }
|
||||
|
||||
private:
|
||||
@ -307,7 +307,7 @@ private:
|
||||
/// \brief Parse up to the end of statement and a return the contents from the
|
||||
/// current token until the end of the statement; the current token on exit
|
||||
/// will be either the EndOfStatement or EOF.
|
||||
virtual StringRef ParseStringToEndOfStatement();
|
||||
virtual StringRef parseStringToEndOfStatement();
|
||||
|
||||
/// \brief Parse until the end of a statement or a comma is encountered,
|
||||
/// return the contents from the current token up to the end or comma.
|
||||
@ -430,7 +430,7 @@ private:
|
||||
bool ParseDirectiveElseIf(SMLoc DirectiveLoc); // ".elseif"
|
||||
bool ParseDirectiveElse(SMLoc DirectiveLoc); // ".else"
|
||||
bool ParseDirectiveEndIf(SMLoc DirectiveLoc); // .endif
|
||||
virtual bool ParseEscapedString(std::string &Data);
|
||||
virtual bool parseEscapedString(std::string &Data);
|
||||
|
||||
const MCExpr *ApplyModifierToExpr(const MCExpr *E,
|
||||
MCSymbolRefExpr::VariantKind Variant);
|
||||
@ -618,7 +618,7 @@ bool AsmParser::Run(bool NoInitialTextSection, bool NoFinalize) {
|
||||
// We had an error, validate that one was emitted and recover by skipping to
|
||||
// the next line.
|
||||
assert(HadError && "Parse statement returned an error, but none emitted!");
|
||||
EatToEndOfStatement();
|
||||
eatToEndOfStatement();
|
||||
}
|
||||
|
||||
if (TheCondState.TheCond != StartingCondState.TheCond ||
|
||||
@ -665,15 +665,15 @@ bool AsmParser::Run(bool NoInitialTextSection, bool NoFinalize) {
|
||||
return HadError;
|
||||
}
|
||||
|
||||
void AsmParser::CheckForValidSection() {
|
||||
void AsmParser::checkForValidSection() {
|
||||
if (!ParsingInlineAsm && !getStreamer().getCurrentSection()) {
|
||||
TokError("expected section directive before assembly directive");
|
||||
Out.InitToTextSection();
|
||||
}
|
||||
}
|
||||
|
||||
/// EatToEndOfStatement - Throw away the rest of the line for testing purposes.
|
||||
void AsmParser::EatToEndOfStatement() {
|
||||
/// eatToEndOfStatement - Throw away the rest of the line for testing purposes.
|
||||
void AsmParser::eatToEndOfStatement() {
|
||||
while (Lexer.isNot(AsmToken::EndOfStatement) &&
|
||||
Lexer.isNot(AsmToken::Eof))
|
||||
Lex();
|
||||
@ -683,7 +683,7 @@ void AsmParser::EatToEndOfStatement() {
|
||||
Lex();
|
||||
}
|
||||
|
||||
StringRef AsmParser::ParseStringToEndOfStatement() {
|
||||
StringRef AsmParser::parseStringToEndOfStatement() {
|
||||
const char *Start = getTok().getLoc().getPointer();
|
||||
|
||||
while (Lexer.isNot(AsmToken::EndOfStatement) &&
|
||||
@ -712,7 +712,7 @@ StringRef AsmParser::ParseStringToComma() {
|
||||
/// parenexpr ::= expr)
|
||||
///
|
||||
bool AsmParser::ParseParenExpr(const MCExpr *&Res, SMLoc &EndLoc) {
|
||||
if (ParseExpression(Res)) return true;
|
||||
if (parseExpression(Res)) return true;
|
||||
if (Lexer.isNot(AsmToken::RParen))
|
||||
return TokError("expected ')' in parentheses expression");
|
||||
EndLoc = Lexer.getTok().getEndLoc();
|
||||
@ -726,7 +726,7 @@ bool AsmParser::ParseParenExpr(const MCExpr *&Res, SMLoc &EndLoc) {
|
||||
/// bracketexpr ::= expr]
|
||||
///
|
||||
bool AsmParser::ParseBracketExpr(const MCExpr *&Res, SMLoc &EndLoc) {
|
||||
if (ParseExpression(Res)) return true;
|
||||
if (parseExpression(Res)) return true;
|
||||
if (Lexer.isNot(AsmToken::RBrac))
|
||||
return TokError("expected ']' in brackets expression");
|
||||
EndLoc = Lexer.getTok().getEndLoc();
|
||||
@ -759,7 +759,7 @@ bool AsmParser::ParsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
|
||||
case AsmToken::String:
|
||||
case AsmToken::Identifier: {
|
||||
StringRef Identifier;
|
||||
if (ParseIdentifier(Identifier)) {
|
||||
if (parseIdentifier(Identifier)) {
|
||||
if (FirstTokenKind == AsmToken::Dollar)
|
||||
return Error(FirstTokenLoc, "invalid token in expression");
|
||||
return true;
|
||||
@ -864,9 +864,9 @@ bool AsmParser::ParsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
|
||||
}
|
||||
}
|
||||
|
||||
bool AsmParser::ParseExpression(const MCExpr *&Res) {
|
||||
bool AsmParser::parseExpression(const MCExpr *&Res) {
|
||||
SMLoc EndLoc;
|
||||
return ParseExpression(Res, EndLoc);
|
||||
return parseExpression(Res, EndLoc);
|
||||
}
|
||||
|
||||
const MCExpr *
|
||||
@ -917,7 +917,7 @@ AsmParser::ApplyModifierToExpr(const MCExpr *E,
|
||||
llvm_unreachable("Invalid expression kind!");
|
||||
}
|
||||
|
||||
/// ParseExpression - Parse an expression and return it.
|
||||
/// parseExpression - Parse an expression and return it.
|
||||
///
|
||||
/// expr ::= expr &&,|| expr -> lowest.
|
||||
/// expr ::= expr |,^,&,! expr
|
||||
@ -927,7 +927,7 @@ AsmParser::ApplyModifierToExpr(const MCExpr *E,
|
||||
/// expr ::= expr *,/,% expr -> highest.
|
||||
/// expr ::= primaryexpr
|
||||
///
|
||||
bool AsmParser::ParseExpression(const MCExpr *&Res, SMLoc &EndLoc) {
|
||||
bool AsmParser::parseExpression(const MCExpr *&Res, SMLoc &EndLoc) {
|
||||
// Parse the expression.
|
||||
Res = 0;
|
||||
if (ParsePrimaryExpr(Res, EndLoc) || ParseBinOpRHS(1, Res, EndLoc))
|
||||
@ -965,17 +965,17 @@ bool AsmParser::ParseExpression(const MCExpr *&Res, SMLoc &EndLoc) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AsmParser::ParseParenExpression(const MCExpr *&Res, SMLoc &EndLoc) {
|
||||
bool AsmParser::parseParenExpression(const MCExpr *&Res, SMLoc &EndLoc) {
|
||||
Res = 0;
|
||||
return ParseParenExpr(Res, EndLoc) ||
|
||||
ParseBinOpRHS(1, Res, EndLoc);
|
||||
}
|
||||
|
||||
bool AsmParser::ParseAbsoluteExpression(int64_t &Res) {
|
||||
bool AsmParser::parseAbsoluteExpression(int64_t &Res) {
|
||||
const MCExpr *Expr;
|
||||
|
||||
SMLoc StartLoc = Lexer.getLoc();
|
||||
if (ParseExpression(Expr))
|
||||
if (parseExpression(Expr))
|
||||
return true;
|
||||
|
||||
if (!Expr->EvaluateAsAbsolute(Res))
|
||||
@ -1134,7 +1134,7 @@ bool AsmParser::ParseStatement(ParseStatementInfo &Info) {
|
||||
// Treat '.' as a valid identifier in this context.
|
||||
Lex();
|
||||
IDVal = ".";
|
||||
} else if (ParseIdentifier(IDVal)) {
|
||||
} else if (parseIdentifier(IDVal)) {
|
||||
if (!TheCondState.Ignore)
|
||||
return TokError("unexpected token at start of statement");
|
||||
IDVal = "";
|
||||
@ -1177,7 +1177,7 @@ bool AsmParser::ParseStatement(ParseStatementInfo &Info) {
|
||||
// Ignore the statement if in the middle of inactive conditional
|
||||
// (e.g. ".if 0").
|
||||
if (TheCondState.Ignore) {
|
||||
EatToEndOfStatement();
|
||||
eatToEndOfStatement();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1186,7 +1186,7 @@ bool AsmParser::ParseStatement(ParseStatementInfo &Info) {
|
||||
// See what kind of statement we have.
|
||||
switch (Lexer.getKind()) {
|
||||
case AsmToken::Colon: {
|
||||
CheckForValidSection();
|
||||
checkForValidSection();
|
||||
|
||||
// identifier ':' -> Label.
|
||||
Lex();
|
||||
@ -1332,7 +1332,7 @@ bool AsmParser::ParseStatement(ParseStatementInfo &Info) {
|
||||
case DK_ZERO:
|
||||
return ParseDirectiveZero();
|
||||
case DK_EXTERN:
|
||||
EatToEndOfStatement(); // .extern is the default, ignore it.
|
||||
eatToEndOfStatement(); // .extern is the default, ignore it.
|
||||
return false;
|
||||
case DK_GLOBL:
|
||||
case DK_GLOBAL:
|
||||
@ -1460,7 +1460,7 @@ bool AsmParser::ParseStatement(ParseStatementInfo &Info) {
|
||||
if (ParsingInlineAsm && (IDVal == "align" || IDVal == "ALIGN"))
|
||||
return ParseDirectiveMSAlign(IDLoc, Info);
|
||||
|
||||
CheckForValidSection();
|
||||
checkForValidSection();
|
||||
|
||||
// Canonicalize the opcode to lower case.
|
||||
std::string OpcodeStr = IDVal.lower();
|
||||
@ -2002,7 +2002,7 @@ bool AsmParser::ParseAssignment(StringRef Name, bool allow_redef,
|
||||
SMLoc EqualLoc = Lexer.getLoc();
|
||||
|
||||
const MCExpr *Value;
|
||||
if (ParseExpression(Value))
|
||||
if (parseExpression(Value))
|
||||
return true;
|
||||
|
||||
// Note: we don't count b as used in "a = b". This is to allow
|
||||
@ -2059,10 +2059,10 @@ bool AsmParser::ParseAssignment(StringRef Name, bool allow_redef,
|
||||
return false;
|
||||
}
|
||||
|
||||
/// ParseIdentifier:
|
||||
/// parseIdentifier:
|
||||
/// ::= identifier
|
||||
/// ::= string
|
||||
bool AsmParser::ParseIdentifier(StringRef &Res) {
|
||||
bool AsmParser::parseIdentifier(StringRef &Res) {
|
||||
// The assembler has relaxed rules for accepting identifiers, in particular we
|
||||
// allow things like '.globl $foo', which would normally be separate
|
||||
// tokens. At this level, we have already lexed so we cannot (currently)
|
||||
@ -2105,7 +2105,7 @@ bool AsmParser::ParseIdentifier(StringRef &Res) {
|
||||
bool AsmParser::ParseDirectiveSet(StringRef IDVal, bool allow_redef) {
|
||||
StringRef Name;
|
||||
|
||||
if (ParseIdentifier(Name))
|
||||
if (parseIdentifier(Name))
|
||||
return TokError("expected identifier after '" + Twine(IDVal) + "'");
|
||||
|
||||
if (getLexer().isNot(AsmToken::Comma))
|
||||
@ -2115,7 +2115,7 @@ bool AsmParser::ParseDirectiveSet(StringRef IDVal, bool allow_redef) {
|
||||
return ParseAssignment(Name, allow_redef, true);
|
||||
}
|
||||
|
||||
bool AsmParser::ParseEscapedString(std::string &Data) {
|
||||
bool AsmParser::parseEscapedString(std::string &Data) {
|
||||
assert(getLexer().is(AsmToken::String) && "Unexpected current token!");
|
||||
|
||||
Data = "";
|
||||
@ -2177,14 +2177,14 @@ bool AsmParser::ParseEscapedString(std::string &Data) {
|
||||
/// ::= ( .ascii | .asciz | .string ) [ "string" ( , "string" )* ]
|
||||
bool AsmParser::ParseDirectiveAscii(StringRef IDVal, bool ZeroTerminated) {
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
CheckForValidSection();
|
||||
checkForValidSection();
|
||||
|
||||
for (;;) {
|
||||
if (getLexer().isNot(AsmToken::String))
|
||||
return TokError("expected string in '" + Twine(IDVal) + "' directive");
|
||||
|
||||
std::string Data;
|
||||
if (ParseEscapedString(Data))
|
||||
if (parseEscapedString(Data))
|
||||
return true;
|
||||
|
||||
getStreamer().EmitBytes(Data, DEFAULT_ADDRSPACE);
|
||||
@ -2210,12 +2210,12 @@ bool AsmParser::ParseDirectiveAscii(StringRef IDVal, bool ZeroTerminated) {
|
||||
/// ::= (.byte | .short | ... ) [ expression (, expression)* ]
|
||||
bool AsmParser::ParseDirectiveValue(unsigned Size) {
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
CheckForValidSection();
|
||||
checkForValidSection();
|
||||
|
||||
for (;;) {
|
||||
const MCExpr *Value;
|
||||
SMLoc ExprLoc = getLexer().getLoc();
|
||||
if (ParseExpression(Value))
|
||||
if (parseExpression(Value))
|
||||
return true;
|
||||
|
||||
// Special case constant expressions to match code generator.
|
||||
@ -2246,7 +2246,7 @@ bool AsmParser::ParseDirectiveValue(unsigned Size) {
|
||||
/// ::= (.single | .double) [ expression (, expression)* ]
|
||||
bool AsmParser::ParseDirectiveRealValue(const fltSemantics &Semantics) {
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
CheckForValidSection();
|
||||
checkForValidSection();
|
||||
|
||||
for (;;) {
|
||||
// We don't truly support arithmetic on floating point expressions, so we
|
||||
@ -2303,16 +2303,16 @@ bool AsmParser::ParseDirectiveRealValue(const fltSemantics &Semantics) {
|
||||
/// ParseDirectiveZero
|
||||
/// ::= .zero expression
|
||||
bool AsmParser::ParseDirectiveZero() {
|
||||
CheckForValidSection();
|
||||
checkForValidSection();
|
||||
|
||||
int64_t NumBytes;
|
||||
if (ParseAbsoluteExpression(NumBytes))
|
||||
if (parseAbsoluteExpression(NumBytes))
|
||||
return true;
|
||||
|
||||
int64_t Val = 0;
|
||||
if (getLexer().is(AsmToken::Comma)) {
|
||||
Lex();
|
||||
if (ParseAbsoluteExpression(Val))
|
||||
if (parseAbsoluteExpression(Val))
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2329,10 +2329,10 @@ bool AsmParser::ParseDirectiveZero() {
|
||||
/// ParseDirectiveFill
|
||||
/// ::= .fill expression , expression , expression
|
||||
bool AsmParser::ParseDirectiveFill() {
|
||||
CheckForValidSection();
|
||||
checkForValidSection();
|
||||
|
||||
int64_t NumValues;
|
||||
if (ParseAbsoluteExpression(NumValues))
|
||||
if (parseAbsoluteExpression(NumValues))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::Comma))
|
||||
@ -2340,7 +2340,7 @@ bool AsmParser::ParseDirectiveFill() {
|
||||
Lex();
|
||||
|
||||
int64_t FillSize;
|
||||
if (ParseAbsoluteExpression(FillSize))
|
||||
if (parseAbsoluteExpression(FillSize))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::Comma))
|
||||
@ -2348,7 +2348,7 @@ bool AsmParser::ParseDirectiveFill() {
|
||||
Lex();
|
||||
|
||||
int64_t FillExpr;
|
||||
if (ParseAbsoluteExpression(FillExpr))
|
||||
if (parseAbsoluteExpression(FillExpr))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -2368,11 +2368,11 @@ bool AsmParser::ParseDirectiveFill() {
|
||||
/// ParseDirectiveOrg
|
||||
/// ::= .org expression [ , expression ]
|
||||
bool AsmParser::ParseDirectiveOrg() {
|
||||
CheckForValidSection();
|
||||
checkForValidSection();
|
||||
|
||||
const MCExpr *Offset;
|
||||
SMLoc Loc = getTok().getLoc();
|
||||
if (ParseExpression(Offset))
|
||||
if (parseExpression(Offset))
|
||||
return true;
|
||||
|
||||
// Parse optional fill expression.
|
||||
@ -2382,7 +2382,7 @@ bool AsmParser::ParseDirectiveOrg() {
|
||||
return TokError("unexpected token in '.org' directive");
|
||||
Lex();
|
||||
|
||||
if (ParseAbsoluteExpression(FillExpr))
|
||||
if (parseAbsoluteExpression(FillExpr))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -2403,11 +2403,11 @@ bool AsmParser::ParseDirectiveOrg() {
|
||||
/// ParseDirectiveAlign
|
||||
/// ::= {.align, ...} expression [ , expression [ , expression ]]
|
||||
bool AsmParser::ParseDirectiveAlign(bool IsPow2, unsigned ValueSize) {
|
||||
CheckForValidSection();
|
||||
checkForValidSection();
|
||||
|
||||
SMLoc AlignmentLoc = getLexer().getLoc();
|
||||
int64_t Alignment;
|
||||
if (ParseAbsoluteExpression(Alignment))
|
||||
if (parseAbsoluteExpression(Alignment))
|
||||
return true;
|
||||
|
||||
SMLoc MaxBytesLoc;
|
||||
@ -2424,7 +2424,7 @@ bool AsmParser::ParseDirectiveAlign(bool IsPow2, unsigned ValueSize) {
|
||||
// .align 3,,4
|
||||
if (getLexer().isNot(AsmToken::Comma)) {
|
||||
HasFillExpr = true;
|
||||
if (ParseAbsoluteExpression(FillExpr))
|
||||
if (parseAbsoluteExpression(FillExpr))
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2434,7 +2434,7 @@ bool AsmParser::ParseDirectiveAlign(bool IsPow2, unsigned ValueSize) {
|
||||
Lex();
|
||||
|
||||
MaxBytesLoc = getLexer().getLoc();
|
||||
if (ParseAbsoluteExpression(MaxBytesToFill))
|
||||
if (parseAbsoluteExpression(MaxBytesToFill))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -2608,7 +2608,7 @@ bool AsmParser::ParseDirectiveLoc() {
|
||||
|
||||
StringRef Name;
|
||||
SMLoc Loc = getTok().getLoc();
|
||||
if (ParseIdentifier(Name))
|
||||
if (parseIdentifier(Name))
|
||||
return TokError("unexpected token in '.loc' directive");
|
||||
|
||||
if (Name == "basic_block")
|
||||
@ -2620,7 +2620,7 @@ bool AsmParser::ParseDirectiveLoc() {
|
||||
else if (Name == "is_stmt") {
|
||||
Loc = getTok().getLoc();
|
||||
const MCExpr *Value;
|
||||
if (ParseExpression(Value))
|
||||
if (parseExpression(Value))
|
||||
return true;
|
||||
// The expression must be the constant 0 or 1.
|
||||
if (const MCConstantExpr *MCE = dyn_cast<MCConstantExpr>(Value)) {
|
||||
@ -2639,7 +2639,7 @@ bool AsmParser::ParseDirectiveLoc() {
|
||||
else if (Name == "isa") {
|
||||
Loc = getTok().getLoc();
|
||||
const MCExpr *Value;
|
||||
if (ParseExpression(Value))
|
||||
if (parseExpression(Value))
|
||||
return true;
|
||||
// The expression must be a constant greater or equal to 0.
|
||||
if (const MCConstantExpr *MCE = dyn_cast<MCConstantExpr>(Value)) {
|
||||
@ -2653,7 +2653,7 @@ bool AsmParser::ParseDirectiveLoc() {
|
||||
}
|
||||
}
|
||||
else if (Name == "discriminator") {
|
||||
if (ParseAbsoluteExpression(Discriminator))
|
||||
if (parseAbsoluteExpression(Discriminator))
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
@ -2684,7 +2684,7 @@ bool AsmParser::ParseDirectiveCFISections() {
|
||||
bool EH = false;
|
||||
bool Debug = false;
|
||||
|
||||
if (ParseIdentifier(Name))
|
||||
if (parseIdentifier(Name))
|
||||
return TokError("Expected an identifier");
|
||||
|
||||
if (Name == ".eh_frame")
|
||||
@ -2695,7 +2695,7 @@ bool AsmParser::ParseDirectiveCFISections() {
|
||||
if (getLexer().is(AsmToken::Comma)) {
|
||||
Lex();
|
||||
|
||||
if (ParseIdentifier(Name))
|
||||
if (parseIdentifier(Name))
|
||||
return TokError("Expected an identifier");
|
||||
|
||||
if (Name == ".eh_frame")
|
||||
@ -2732,7 +2732,7 @@ bool AsmParser::ParseRegisterOrRegisterNumber(int64_t &Register,
|
||||
return true;
|
||||
Register = getContext().getRegisterInfo().getDwarfRegNum(RegNo, true);
|
||||
} else
|
||||
return ParseAbsoluteExpression(Register);
|
||||
return parseAbsoluteExpression(Register);
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -2749,7 +2749,7 @@ bool AsmParser::ParseDirectiveCFIDefCfa(SMLoc DirectiveLoc) {
|
||||
Lex();
|
||||
|
||||
int64_t Offset = 0;
|
||||
if (ParseAbsoluteExpression(Offset))
|
||||
if (parseAbsoluteExpression(Offset))
|
||||
return true;
|
||||
|
||||
getStreamer().EmitCFIDefCfa(Register, Offset);
|
||||
@ -2760,7 +2760,7 @@ bool AsmParser::ParseDirectiveCFIDefCfa(SMLoc DirectiveLoc) {
|
||||
/// ::= .cfi_def_cfa_offset offset
|
||||
bool AsmParser::ParseDirectiveCFIDefCfaOffset() {
|
||||
int64_t Offset = 0;
|
||||
if (ParseAbsoluteExpression(Offset))
|
||||
if (parseAbsoluteExpression(Offset))
|
||||
return true;
|
||||
|
||||
getStreamer().EmitCFIDefCfaOffset(Offset);
|
||||
@ -2790,7 +2790,7 @@ bool AsmParser::ParseDirectiveCFIRegister(SMLoc DirectiveLoc) {
|
||||
/// ::= .cfi_adjust_cfa_offset adjustment
|
||||
bool AsmParser::ParseDirectiveCFIAdjustCfaOffset() {
|
||||
int64_t Adjustment = 0;
|
||||
if (ParseAbsoluteExpression(Adjustment))
|
||||
if (parseAbsoluteExpression(Adjustment))
|
||||
return true;
|
||||
|
||||
getStreamer().EmitCFIAdjustCfaOffset(Adjustment);
|
||||
@ -2821,7 +2821,7 @@ bool AsmParser::ParseDirectiveCFIOffset(SMLoc DirectiveLoc) {
|
||||
return TokError("unexpected token in directive");
|
||||
Lex();
|
||||
|
||||
if (ParseAbsoluteExpression(Offset))
|
||||
if (parseAbsoluteExpression(Offset))
|
||||
return true;
|
||||
|
||||
getStreamer().EmitCFIOffset(Register, Offset);
|
||||
@ -2841,7 +2841,7 @@ bool AsmParser::ParseDirectiveCFIRelOffset(SMLoc DirectiveLoc) {
|
||||
Lex();
|
||||
|
||||
int64_t Offset = 0;
|
||||
if (ParseAbsoluteExpression(Offset))
|
||||
if (parseAbsoluteExpression(Offset))
|
||||
return true;
|
||||
|
||||
getStreamer().EmitCFIRelOffset(Register, Offset);
|
||||
@ -2876,7 +2876,7 @@ static bool isValidEncoding(int64_t Encoding) {
|
||||
/// ::= .cfi_lsda encoding, [symbol_name]
|
||||
bool AsmParser::ParseDirectiveCFIPersonalityOrLsda(bool IsPersonality) {
|
||||
int64_t Encoding = 0;
|
||||
if (ParseAbsoluteExpression(Encoding))
|
||||
if (parseAbsoluteExpression(Encoding))
|
||||
return true;
|
||||
if (Encoding == dwarf::DW_EH_PE_omit)
|
||||
return false;
|
||||
@ -2889,7 +2889,7 @@ bool AsmParser::ParseDirectiveCFIPersonalityOrLsda(bool IsPersonality) {
|
||||
Lex();
|
||||
|
||||
StringRef Name;
|
||||
if (ParseIdentifier(Name))
|
||||
if (parseIdentifier(Name))
|
||||
return TokError("expected identifier in directive");
|
||||
|
||||
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name);
|
||||
@ -2943,7 +2943,7 @@ bool AsmParser::ParseDirectiveCFIRestore(SMLoc DirectiveLoc) {
|
||||
bool AsmParser::ParseDirectiveCFIEscape() {
|
||||
std::string Values;
|
||||
int64_t CurrValue;
|
||||
if (ParseAbsoluteExpression(CurrValue))
|
||||
if (parseAbsoluteExpression(CurrValue))
|
||||
return true;
|
||||
|
||||
Values.push_back((uint8_t)CurrValue);
|
||||
@ -2951,7 +2951,7 @@ bool AsmParser::ParseDirectiveCFIEscape() {
|
||||
while (getLexer().is(AsmToken::Comma)) {
|
||||
Lex();
|
||||
|
||||
if (ParseAbsoluteExpression(CurrValue))
|
||||
if (parseAbsoluteExpression(CurrValue))
|
||||
return true;
|
||||
|
||||
Values.push_back((uint8_t)CurrValue);
|
||||
@ -3000,7 +3000,7 @@ bool AsmParser::ParseDirectiveMacrosOnOff(StringRef Directive) {
|
||||
/// ::= .macro name [parameters]
|
||||
bool AsmParser::ParseDirectiveMacro(SMLoc DirectiveLoc) {
|
||||
StringRef Name;
|
||||
if (ParseIdentifier(Name))
|
||||
if (parseIdentifier(Name))
|
||||
return TokError("expected identifier in '.macro' directive");
|
||||
|
||||
MCAsmMacroParameters Parameters;
|
||||
@ -3010,7 +3010,7 @@ bool AsmParser::ParseDirectiveMacro(SMLoc DirectiveLoc) {
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
for (;;) {
|
||||
MCAsmMacroParameter Parameter;
|
||||
if (ParseIdentifier(Parameter.first))
|
||||
if (parseIdentifier(Parameter.first))
|
||||
return TokError("expected identifier in '.macro' directive");
|
||||
|
||||
if (getLexer().is(AsmToken::Equal)) {
|
||||
@ -3052,7 +3052,7 @@ bool AsmParser::ParseDirectiveMacro(SMLoc DirectiveLoc) {
|
||||
}
|
||||
|
||||
// Otherwise, scan til the end of the statement.
|
||||
EatToEndOfStatement();
|
||||
eatToEndOfStatement();
|
||||
}
|
||||
|
||||
if (LookupMacro(Name)) {
|
||||
@ -3193,7 +3193,7 @@ bool AsmParser::ParseDirectiveEndMacro(StringRef Directive) {
|
||||
/// ::= .purgem
|
||||
bool AsmParser::ParseDirectivePurgeMacro(SMLoc DirectiveLoc) {
|
||||
StringRef Name;
|
||||
if (ParseIdentifier(Name))
|
||||
if (parseIdentifier(Name))
|
||||
return TokError("expected identifier in '.purgem' directive");
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -3209,13 +3209,13 @@ bool AsmParser::ParseDirectivePurgeMacro(SMLoc DirectiveLoc) {
|
||||
/// ParseDirectiveBundleAlignMode
|
||||
/// ::= {.bundle_align_mode} expression
|
||||
bool AsmParser::ParseDirectiveBundleAlignMode() {
|
||||
CheckForValidSection();
|
||||
checkForValidSection();
|
||||
|
||||
// Expect a single argument: an expression that evaluates to a constant
|
||||
// in the inclusive range 0-30.
|
||||
SMLoc ExprLoc = getLexer().getLoc();
|
||||
int64_t AlignSizePow2;
|
||||
if (ParseAbsoluteExpression(AlignSizePow2))
|
||||
if (parseAbsoluteExpression(AlignSizePow2))
|
||||
return true;
|
||||
else if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
return TokError("unexpected token after expression in"
|
||||
@ -3235,7 +3235,7 @@ bool AsmParser::ParseDirectiveBundleAlignMode() {
|
||||
/// ParseDirectiveBundleLock
|
||||
/// ::= {.bundle_lock} [align_to_end]
|
||||
bool AsmParser::ParseDirectiveBundleLock() {
|
||||
CheckForValidSection();
|
||||
checkForValidSection();
|
||||
bool AlignToEnd = false;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
@ -3244,7 +3244,7 @@ bool AsmParser::ParseDirectiveBundleLock() {
|
||||
const char *kInvalidOptionError =
|
||||
"invalid option for '.bundle_lock' directive";
|
||||
|
||||
if (ParseIdentifier(Option))
|
||||
if (parseIdentifier(Option))
|
||||
return Error(Loc, kInvalidOptionError);
|
||||
|
||||
if (Option != "align_to_end")
|
||||
@ -3264,7 +3264,7 @@ bool AsmParser::ParseDirectiveBundleLock() {
|
||||
/// ParseDirectiveBundleLock
|
||||
/// ::= {.bundle_lock}
|
||||
bool AsmParser::ParseDirectiveBundleUnlock() {
|
||||
CheckForValidSection();
|
||||
checkForValidSection();
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
return TokError("unexpected token in '.bundle_unlock' directive");
|
||||
@ -3277,10 +3277,10 @@ bool AsmParser::ParseDirectiveBundleUnlock() {
|
||||
/// ParseDirectiveSpace
|
||||
/// ::= (.skip | .space) expression [ , expression ]
|
||||
bool AsmParser::ParseDirectiveSpace(StringRef IDVal) {
|
||||
CheckForValidSection();
|
||||
checkForValidSection();
|
||||
|
||||
int64_t NumBytes;
|
||||
if (ParseAbsoluteExpression(NumBytes))
|
||||
if (parseAbsoluteExpression(NumBytes))
|
||||
return true;
|
||||
|
||||
int64_t FillExpr = 0;
|
||||
@ -3289,7 +3289,7 @@ bool AsmParser::ParseDirectiveSpace(StringRef IDVal) {
|
||||
return TokError("unexpected token in '" + Twine(IDVal) + "' directive");
|
||||
Lex();
|
||||
|
||||
if (ParseAbsoluteExpression(FillExpr))
|
||||
if (parseAbsoluteExpression(FillExpr))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -3311,10 +3311,10 @@ bool AsmParser::ParseDirectiveSpace(StringRef IDVal) {
|
||||
/// ParseDirectiveLEB128
|
||||
/// ::= (.sleb128 | .uleb128) expression
|
||||
bool AsmParser::ParseDirectiveLEB128(bool Signed) {
|
||||
CheckForValidSection();
|
||||
checkForValidSection();
|
||||
const MCExpr *Value;
|
||||
|
||||
if (ParseExpression(Value))
|
||||
if (parseExpression(Value))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -3336,7 +3336,7 @@ bool AsmParser::ParseDirectiveSymbolAttribute(MCSymbolAttr Attr) {
|
||||
StringRef Name;
|
||||
SMLoc Loc = getTok().getLoc();
|
||||
|
||||
if (ParseIdentifier(Name))
|
||||
if (parseIdentifier(Name))
|
||||
return Error(Loc, "expected identifier in directive");
|
||||
|
||||
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name);
|
||||
@ -3363,11 +3363,11 @@ bool AsmParser::ParseDirectiveSymbolAttribute(MCSymbolAttr Attr) {
|
||||
/// ParseDirectiveComm
|
||||
/// ::= ( .comm | .lcomm ) identifier , size_expression [ , align_expression ]
|
||||
bool AsmParser::ParseDirectiveComm(bool IsLocal) {
|
||||
CheckForValidSection();
|
||||
checkForValidSection();
|
||||
|
||||
SMLoc IDLoc = getLexer().getLoc();
|
||||
StringRef Name;
|
||||
if (ParseIdentifier(Name))
|
||||
if (parseIdentifier(Name))
|
||||
return TokError("expected identifier in directive");
|
||||
|
||||
// Handle the identifier as the key symbol.
|
||||
@ -3379,7 +3379,7 @@ bool AsmParser::ParseDirectiveComm(bool IsLocal) {
|
||||
|
||||
int64_t Size;
|
||||
SMLoc SizeLoc = getLexer().getLoc();
|
||||
if (ParseAbsoluteExpression(Size))
|
||||
if (parseAbsoluteExpression(Size))
|
||||
return true;
|
||||
|
||||
int64_t Pow2Alignment = 0;
|
||||
@ -3387,7 +3387,7 @@ bool AsmParser::ParseDirectiveComm(bool IsLocal) {
|
||||
if (getLexer().is(AsmToken::Comma)) {
|
||||
Lex();
|
||||
Pow2AlignmentLoc = getLexer().getLoc();
|
||||
if (ParseAbsoluteExpression(Pow2Alignment))
|
||||
if (parseAbsoluteExpression(Pow2Alignment))
|
||||
return true;
|
||||
|
||||
LCOMM::LCOMMType LCOMM = Lexer.getMAI().getLCOMMDirectiveAlignmentType();
|
||||
@ -3440,7 +3440,7 @@ bool AsmParser::ParseDirectiveAbort() {
|
||||
// FIXME: Use loc from directive.
|
||||
SMLoc Loc = getLexer().getLoc();
|
||||
|
||||
StringRef Str = ParseStringToEndOfStatement();
|
||||
StringRef Str = parseStringToEndOfStatement();
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
return TokError("unexpected token in '.abort' directive");
|
||||
|
||||
@ -3512,10 +3512,10 @@ bool AsmParser::ParseDirectiveIf(SMLoc DirectiveLoc) {
|
||||
TheCondStack.push_back(TheCondState);
|
||||
TheCondState.TheCond = AsmCond::IfCond;
|
||||
if (TheCondState.Ignore) {
|
||||
EatToEndOfStatement();
|
||||
eatToEndOfStatement();
|
||||
} else {
|
||||
int64_t ExprValue;
|
||||
if (ParseAbsoluteExpression(ExprValue))
|
||||
if (parseAbsoluteExpression(ExprValue))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -3537,9 +3537,9 @@ bool AsmParser::ParseDirectiveIfb(SMLoc DirectiveLoc, bool ExpectBlank) {
|
||||
TheCondState.TheCond = AsmCond::IfCond;
|
||||
|
||||
if (TheCondState.Ignore) {
|
||||
EatToEndOfStatement();
|
||||
eatToEndOfStatement();
|
||||
} else {
|
||||
StringRef Str = ParseStringToEndOfStatement();
|
||||
StringRef Str = parseStringToEndOfStatement();
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
return TokError("unexpected token in '.ifb' directive");
|
||||
@ -3560,7 +3560,7 @@ bool AsmParser::ParseDirectiveIfc(SMLoc DirectiveLoc, bool ExpectEqual) {
|
||||
TheCondState.TheCond = AsmCond::IfCond;
|
||||
|
||||
if (TheCondState.Ignore) {
|
||||
EatToEndOfStatement();
|
||||
eatToEndOfStatement();
|
||||
} else {
|
||||
StringRef Str1 = ParseStringToComma();
|
||||
|
||||
@ -3569,7 +3569,7 @@ bool AsmParser::ParseDirectiveIfc(SMLoc DirectiveLoc, bool ExpectEqual) {
|
||||
|
||||
Lex();
|
||||
|
||||
StringRef Str2 = ParseStringToEndOfStatement();
|
||||
StringRef Str2 = parseStringToEndOfStatement();
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
return TokError("unexpected token in '.ifc' directive");
|
||||
@ -3591,9 +3591,9 @@ bool AsmParser::ParseDirectiveIfdef(SMLoc DirectiveLoc, bool expect_defined) {
|
||||
TheCondState.TheCond = AsmCond::IfCond;
|
||||
|
||||
if (TheCondState.Ignore) {
|
||||
EatToEndOfStatement();
|
||||
eatToEndOfStatement();
|
||||
} else {
|
||||
if (ParseIdentifier(Name))
|
||||
if (parseIdentifier(Name))
|
||||
return TokError("expected identifier after '.ifdef'");
|
||||
|
||||
Lex();
|
||||
@ -3624,11 +3624,11 @@ bool AsmParser::ParseDirectiveElseIf(SMLoc DirectiveLoc) {
|
||||
LastIgnoreState = TheCondStack.back().Ignore;
|
||||
if (LastIgnoreState || TheCondState.CondMet) {
|
||||
TheCondState.Ignore = true;
|
||||
EatToEndOfStatement();
|
||||
eatToEndOfStatement();
|
||||
}
|
||||
else {
|
||||
int64_t ExprValue;
|
||||
if (ParseAbsoluteExpression(ExprValue))
|
||||
if (parseAbsoluteExpression(ExprValue))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -3822,7 +3822,7 @@ MCAsmMacro *AsmParser::ParseMacroLikeBody(SMLoc DirectiveLoc) {
|
||||
}
|
||||
|
||||
// Otherwise, scan till the end of the statement.
|
||||
EatToEndOfStatement();
|
||||
eatToEndOfStatement();
|
||||
}
|
||||
|
||||
const char *BodyStart = StartToken.getLoc().getPointer();
|
||||
@ -3858,7 +3858,7 @@ void AsmParser::InstantiateMacroLikeBody(MCAsmMacro *M, SMLoc DirectiveLoc,
|
||||
|
||||
bool AsmParser::ParseDirectiveRept(SMLoc DirectiveLoc) {
|
||||
int64_t Count;
|
||||
if (ParseAbsoluteExpression(Count))
|
||||
if (parseAbsoluteExpression(Count))
|
||||
return TokError("unexpected token in '.rept' directive");
|
||||
|
||||
if (Count < 0)
|
||||
@ -3896,7 +3896,7 @@ bool AsmParser::ParseDirectiveIrp(SMLoc DirectiveLoc) {
|
||||
MCAsmMacroParameters Parameters;
|
||||
MCAsmMacroParameter Parameter;
|
||||
|
||||
if (ParseIdentifier(Parameter.first))
|
||||
if (parseIdentifier(Parameter.first))
|
||||
return TokError("expected identifier in '.irp' directive");
|
||||
|
||||
Parameters.push_back(Parameter);
|
||||
@ -3942,7 +3942,7 @@ bool AsmParser::ParseDirectiveIrpc(SMLoc DirectiveLoc) {
|
||||
MCAsmMacroParameters Parameters;
|
||||
MCAsmMacroParameter Parameter;
|
||||
|
||||
if (ParseIdentifier(Parameter.first))
|
||||
if (parseIdentifier(Parameter.first))
|
||||
return TokError("expected identifier in '.irpc' directive");
|
||||
|
||||
Parameters.push_back(Parameter);
|
||||
@ -4006,7 +4006,7 @@ bool AsmParser::ParseDirectiveMSEmit(SMLoc IDLoc, ParseStatementInfo &Info,
|
||||
size_t Len) {
|
||||
const MCExpr *Value;
|
||||
SMLoc ExprLoc = getLexer().getLoc();
|
||||
if (ParseExpression(Value))
|
||||
if (parseExpression(Value))
|
||||
return true;
|
||||
const MCConstantExpr *MCE = dyn_cast<MCConstantExpr>(Value);
|
||||
if (!MCE)
|
||||
@ -4022,7 +4022,7 @@ bool AsmParser::ParseDirectiveMSEmit(SMLoc IDLoc, ParseStatementInfo &Info,
|
||||
bool AsmParser::ParseDirectiveMSAlign(SMLoc IDLoc, ParseStatementInfo &Info) {
|
||||
const MCExpr *Value;
|
||||
SMLoc ExprLoc = getLexer().getLoc();
|
||||
if (ParseExpression(Value))
|
||||
if (parseExpression(Value))
|
||||
return true;
|
||||
const MCConstantExpr *MCE = dyn_cast<MCConstantExpr>(Value);
|
||||
if (!MCE)
|
||||
@ -4063,7 +4063,7 @@ static int RewritesSort(const void *A, const void *B) {
|
||||
}
|
||||
|
||||
bool
|
||||
AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString,
|
||||
AsmParser::parseMSInlineAsm(void *AsmLoc, std::string &AsmString,
|
||||
unsigned &NumOutputs, unsigned &NumInputs,
|
||||
SmallVectorImpl<std::pair<void *, bool> > &OpDecls,
|
||||
SmallVectorImpl<std::string> &Constraints,
|
||||
|
@ -25,10 +25,10 @@ namespace {
|
||||
|
||||
class COFFAsmParser : public MCAsmParserExtension {
|
||||
template<bool (COFFAsmParser::*HandlerMethod)(StringRef, SMLoc)>
|
||||
void AddDirectiveHandler(StringRef Directive) {
|
||||
void addDirectiveHandler(StringRef Directive) {
|
||||
MCAsmParser::ExtensionDirectiveHandler Handler = std::make_pair(
|
||||
this, HandleDirective<COFFAsmParser, HandlerMethod>);
|
||||
getParser().AddDirectiveHandler(Directive, Handler);
|
||||
getParser().addDirectiveHandler(Directive, Handler);
|
||||
}
|
||||
|
||||
bool ParseSectionSwitch(StringRef Section,
|
||||
@ -39,43 +39,43 @@ class COFFAsmParser : public MCAsmParserExtension {
|
||||
// Call the base implementation.
|
||||
MCAsmParserExtension::Initialize(Parser);
|
||||
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSectionDirectiveText>(".text");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSectionDirectiveData>(".data");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSectionDirectiveBSS>(".bss");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseDirectiveDef>(".def");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseDirectiveScl>(".scl");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseDirectiveType>(".type");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseDirectiveEndef>(".endef");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseDirectiveSecRel32>(".secrel32");
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSectionDirectiveText>(".text");
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSectionDirectiveData>(".data");
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSectionDirectiveBSS>(".bss");
|
||||
addDirectiveHandler<&COFFAsmParser::ParseDirectiveDef>(".def");
|
||||
addDirectiveHandler<&COFFAsmParser::ParseDirectiveScl>(".scl");
|
||||
addDirectiveHandler<&COFFAsmParser::ParseDirectiveType>(".type");
|
||||
addDirectiveHandler<&COFFAsmParser::ParseDirectiveEndef>(".endef");
|
||||
addDirectiveHandler<&COFFAsmParser::ParseDirectiveSecRel32>(".secrel32");
|
||||
|
||||
// Win64 EH directives.
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveStartProc>(
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveStartProc>(
|
||||
".seh_proc");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveEndProc>(
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveEndProc>(
|
||||
".seh_endproc");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveStartChained>(
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveStartChained>(
|
||||
".seh_startchained");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveEndChained>(
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveEndChained>(
|
||||
".seh_endchained");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveHandler>(
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveHandler>(
|
||||
".seh_handler");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveHandlerData>(
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveHandlerData>(
|
||||
".seh_handlerdata");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectivePushReg>(
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSEHDirectivePushReg>(
|
||||
".seh_pushreg");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveSetFrame>(
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveSetFrame>(
|
||||
".seh_setframe");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveAllocStack>(
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveAllocStack>(
|
||||
".seh_stackalloc");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveSaveReg>(
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveSaveReg>(
|
||||
".seh_savereg");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveSaveXMM>(
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveSaveXMM>(
|
||||
".seh_savexmm");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectivePushFrame>(
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSEHDirectivePushFrame>(
|
||||
".seh_pushframe");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveEndProlog>(
|
||||
addDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveEndProlog>(
|
||||
".seh_endprologue");
|
||||
AddDirectiveHandler<&COFFAsmParser::ParseDirectiveSymbolAttribute>(".weak");
|
||||
addDirectiveHandler<&COFFAsmParser::ParseDirectiveSymbolAttribute>(".weak");
|
||||
}
|
||||
|
||||
bool ParseSectionDirectiveText(StringRef, SMLoc) {
|
||||
@ -141,7 +141,7 @@ bool COFFAsmParser::ParseDirectiveSymbolAttribute(StringRef Directive, SMLoc) {
|
||||
for (;;) {
|
||||
StringRef Name;
|
||||
|
||||
if (getParser().ParseIdentifier(Name))
|
||||
if (getParser().parseIdentifier(Name))
|
||||
return TokError("expected identifier in directive");
|
||||
|
||||
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name);
|
||||
@ -177,7 +177,7 @@ bool COFFAsmParser::ParseSectionSwitch(StringRef Section,
|
||||
bool COFFAsmParser::ParseDirectiveDef(StringRef, SMLoc) {
|
||||
StringRef SymbolName;
|
||||
|
||||
if (getParser().ParseIdentifier(SymbolName))
|
||||
if (getParser().parseIdentifier(SymbolName))
|
||||
return TokError("expected identifier in directive");
|
||||
|
||||
MCSymbol *Sym = getContext().GetOrCreateSymbol(SymbolName);
|
||||
@ -190,7 +190,7 @@ bool COFFAsmParser::ParseDirectiveDef(StringRef, SMLoc) {
|
||||
|
||||
bool COFFAsmParser::ParseDirectiveScl(StringRef, SMLoc) {
|
||||
int64_t SymbolStorageClass;
|
||||
if (getParser().ParseAbsoluteExpression(SymbolStorageClass))
|
||||
if (getParser().parseAbsoluteExpression(SymbolStorageClass))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -203,7 +203,7 @@ bool COFFAsmParser::ParseDirectiveScl(StringRef, SMLoc) {
|
||||
|
||||
bool COFFAsmParser::ParseDirectiveType(StringRef, SMLoc) {
|
||||
int64_t Type;
|
||||
if (getParser().ParseAbsoluteExpression(Type))
|
||||
if (getParser().parseAbsoluteExpression(Type))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -222,7 +222,7 @@ bool COFFAsmParser::ParseDirectiveEndef(StringRef, SMLoc) {
|
||||
|
||||
bool COFFAsmParser::ParseDirectiveSecRel32(StringRef, SMLoc) {
|
||||
StringRef SymbolID;
|
||||
if (getParser().ParseIdentifier(SymbolID))
|
||||
if (getParser().parseIdentifier(SymbolID))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -237,7 +237,7 @@ bool COFFAsmParser::ParseDirectiveSecRel32(StringRef, SMLoc) {
|
||||
|
||||
bool COFFAsmParser::ParseSEHDirectiveStartProc(StringRef, SMLoc) {
|
||||
StringRef SymbolID;
|
||||
if (getParser().ParseIdentifier(SymbolID))
|
||||
if (getParser().parseIdentifier(SymbolID))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -270,7 +270,7 @@ bool COFFAsmParser::ParseSEHDirectiveEndChained(StringRef, SMLoc) {
|
||||
|
||||
bool COFFAsmParser::ParseSEHDirectiveHandler(StringRef, SMLoc) {
|
||||
StringRef SymbolID;
|
||||
if (getParser().ParseIdentifier(SymbolID))
|
||||
if (getParser().parseIdentifier(SymbolID))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::Comma))
|
||||
@ -323,7 +323,7 @@ bool COFFAsmParser::ParseSEHDirectiveSetFrame(StringRef, SMLoc L) {
|
||||
|
||||
Lex();
|
||||
SMLoc startLoc = getLexer().getLoc();
|
||||
if (getParser().ParseAbsoluteExpression(Off))
|
||||
if (getParser().parseAbsoluteExpression(Off))
|
||||
return true;
|
||||
|
||||
if (Off & 0x0F)
|
||||
@ -340,7 +340,7 @@ bool COFFAsmParser::ParseSEHDirectiveSetFrame(StringRef, SMLoc L) {
|
||||
bool COFFAsmParser::ParseSEHDirectiveAllocStack(StringRef, SMLoc) {
|
||||
int64_t Size;
|
||||
SMLoc startLoc = getLexer().getLoc();
|
||||
if (getParser().ParseAbsoluteExpression(Size))
|
||||
if (getParser().parseAbsoluteExpression(Size))
|
||||
return true;
|
||||
|
||||
if (Size & 7)
|
||||
@ -364,7 +364,7 @@ bool COFFAsmParser::ParseSEHDirectiveSaveReg(StringRef, SMLoc L) {
|
||||
|
||||
Lex();
|
||||
SMLoc startLoc = getLexer().getLoc();
|
||||
if (getParser().ParseAbsoluteExpression(Off))
|
||||
if (getParser().parseAbsoluteExpression(Off))
|
||||
return true;
|
||||
|
||||
if (Off & 7)
|
||||
@ -391,7 +391,7 @@ bool COFFAsmParser::ParseSEHDirectiveSaveXMM(StringRef, SMLoc L) {
|
||||
|
||||
Lex();
|
||||
SMLoc startLoc = getLexer().getLoc();
|
||||
if (getParser().ParseAbsoluteExpression(Off))
|
||||
if (getParser().parseAbsoluteExpression(Off))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -412,7 +412,7 @@ bool COFFAsmParser::ParseSEHDirectivePushFrame(StringRef, SMLoc) {
|
||||
if (getLexer().is(AsmToken::At)) {
|
||||
SMLoc startLoc = getLexer().getLoc();
|
||||
Lex();
|
||||
if (!getParser().ParseIdentifier(CodeID)) {
|
||||
if (!getParser().parseIdentifier(CodeID)) {
|
||||
if (CodeID != "code")
|
||||
return Error(startLoc, "expected @code");
|
||||
Code = true;
|
||||
@ -439,7 +439,7 @@ bool COFFAsmParser::ParseAtUnwindOrAtExcept(bool &unwind, bool &except) {
|
||||
return TokError("a handler attribute must begin with '@'");
|
||||
SMLoc startLoc = getLexer().getLoc();
|
||||
Lex();
|
||||
if (getParser().ParseIdentifier(identifier))
|
||||
if (getParser().parseIdentifier(identifier))
|
||||
return Error(startLoc, "expected @unwind or @except");
|
||||
if (identifier == "unwind")
|
||||
unwind = true;
|
||||
@ -480,7 +480,7 @@ bool COFFAsmParser::ParseSEHRegisterNumber(unsigned &RegNo) {
|
||||
}
|
||||
else {
|
||||
int64_t n;
|
||||
if (getParser().ParseAbsoluteExpression(n))
|
||||
if (getParser().parseAbsoluteExpression(n))
|
||||
return true;
|
||||
if (n > 15)
|
||||
return Error(startLoc, "register number is too high");
|
||||
|
@ -27,10 +27,10 @@ namespace {
|
||||
/// Darwin targets.
|
||||
class DarwinAsmParser : public MCAsmParserExtension {
|
||||
template<bool (DarwinAsmParser::*HandlerMethod)(StringRef, SMLoc)>
|
||||
void AddDirectiveHandler(StringRef Directive) {
|
||||
void addDirectiveHandler(StringRef Directive) {
|
||||
MCAsmParser::ExtensionDirectiveHandler Handler = std::make_pair(
|
||||
this, HandleDirective<DarwinAsmParser, HandlerMethod>);
|
||||
getParser().AddDirectiveHandler(Directive, Handler);
|
||||
getParser().addDirectiveHandler(Directive, Handler);
|
||||
}
|
||||
|
||||
bool ParseSectionSwitch(const char *Segment, const char *Section,
|
||||
@ -44,122 +44,122 @@ public:
|
||||
// Call the base implementation.
|
||||
this->MCAsmParserExtension::Initialize(Parser);
|
||||
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectiveDesc>(".desc");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectiveLsym>(".lsym");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectiveSubsectionsViaSymbols>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectiveDesc>(".desc");
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectiveLsym>(".lsym");
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectiveSubsectionsViaSymbols>(
|
||||
".subsections_via_symbols");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectiveDumpOrLoad>(".dump");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectiveDumpOrLoad>(".load");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectiveSection>(".section");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectivePushSection>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectiveDumpOrLoad>(".dump");
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectiveDumpOrLoad>(".load");
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectiveSection>(".section");
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectivePushSection>(
|
||||
".pushsection");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectivePopSection>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectivePopSection>(
|
||||
".popsection");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectivePrevious>(".previous");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectiveSecureLogUnique>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectivePrevious>(".previous");
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectiveSecureLogUnique>(
|
||||
".secure_log_unique");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectiveSecureLogReset>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectiveSecureLogReset>(
|
||||
".secure_log_reset");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectiveTBSS>(".tbss");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectiveZerofill>(".zerofill");
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectiveTBSS>(".tbss");
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectiveZerofill>(".zerofill");
|
||||
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectiveDataRegion>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectiveDataRegion>(
|
||||
".data_region");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectiveDataRegionEnd>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectiveDataRegionEnd>(
|
||||
".end_data_region");
|
||||
|
||||
// Special section directives.
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveConst>(".const");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveConstData>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveConst>(".const");
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveConstData>(
|
||||
".const_data");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveConstructor>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveConstructor>(
|
||||
".constructor");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveCString>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveCString>(
|
||||
".cstring");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveData>(".data");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveDestructor>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveData>(".data");
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveDestructor>(
|
||||
".destructor");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveDyld>(".dyld");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveFVMLibInit0>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveDyld>(".dyld");
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveFVMLibInit0>(
|
||||
".fvmlib_init0");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveFVMLibInit1>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveFVMLibInit1>(
|
||||
".fvmlib_init1");
|
||||
AddDirectiveHandler<
|
||||
addDirectiveHandler<
|
||||
&DarwinAsmParser::ParseSectionDirectiveLazySymbolPointers>(
|
||||
".lazy_symbol_pointer");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectiveLinkerOption>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseDirectiveLinkerOption>(
|
||||
".linker_option");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveLiteral16>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveLiteral16>(
|
||||
".literal16");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveLiteral4>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveLiteral4>(
|
||||
".literal4");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveLiteral8>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveLiteral8>(
|
||||
".literal8");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveModInitFunc>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveModInitFunc>(
|
||||
".mod_init_func");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveModTermFunc>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveModTermFunc>(
|
||||
".mod_term_func");
|
||||
AddDirectiveHandler<
|
||||
addDirectiveHandler<
|
||||
&DarwinAsmParser::ParseSectionDirectiveNonLazySymbolPointers>(
|
||||
".non_lazy_symbol_pointer");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCCatClsMeth>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCCatClsMeth>(
|
||||
".objc_cat_cls_meth");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCCatInstMeth>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCCatInstMeth>(
|
||||
".objc_cat_inst_meth");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCCategory>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCCategory>(
|
||||
".objc_category");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCClass>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCClass>(
|
||||
".objc_class");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCClassNames>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCClassNames>(
|
||||
".objc_class_names");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCClassVars>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCClassVars>(
|
||||
".objc_class_vars");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCClsMeth>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCClsMeth>(
|
||||
".objc_cls_meth");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCClsRefs>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCClsRefs>(
|
||||
".objc_cls_refs");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCInstMeth>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCInstMeth>(
|
||||
".objc_inst_meth");
|
||||
AddDirectiveHandler<
|
||||
addDirectiveHandler<
|
||||
&DarwinAsmParser::ParseSectionDirectiveObjCInstanceVars>(
|
||||
".objc_instance_vars");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCMessageRefs>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCMessageRefs>(
|
||||
".objc_message_refs");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCMetaClass>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCMetaClass>(
|
||||
".objc_meta_class");
|
||||
AddDirectiveHandler<
|
||||
addDirectiveHandler<
|
||||
&DarwinAsmParser::ParseSectionDirectiveObjCMethVarNames>(
|
||||
".objc_meth_var_names");
|
||||
AddDirectiveHandler<
|
||||
addDirectiveHandler<
|
||||
&DarwinAsmParser::ParseSectionDirectiveObjCMethVarTypes>(
|
||||
".objc_meth_var_types");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCModuleInfo>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCModuleInfo>(
|
||||
".objc_module_info");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCProtocol>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCProtocol>(
|
||||
".objc_protocol");
|
||||
AddDirectiveHandler<
|
||||
addDirectiveHandler<
|
||||
&DarwinAsmParser::ParseSectionDirectiveObjCSelectorStrs>(
|
||||
".objc_selector_strs");
|
||||
AddDirectiveHandler<
|
||||
addDirectiveHandler<
|
||||
&DarwinAsmParser::ParseSectionDirectiveObjCStringObject>(
|
||||
".objc_string_object");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCSymbols>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveObjCSymbols>(
|
||||
".objc_symbols");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectivePICSymbolStub>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectivePICSymbolStub>(
|
||||
".picsymbol_stub");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveStaticConst>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveStaticConst>(
|
||||
".static_const");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveStaticData>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveStaticData>(
|
||||
".static_data");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveSymbolStub>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveSymbolStub>(
|
||||
".symbol_stub");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveTData>(".tdata");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveText>(".text");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveThreadInitFunc>(
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveTData>(".tdata");
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveText>(".text");
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveThreadInitFunc>(
|
||||
".thread_init_func");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveTLV>(".tlv");
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveTLV>(".tlv");
|
||||
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveIdent>(".ident");
|
||||
addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveIdent>(".ident");
|
||||
}
|
||||
|
||||
bool ParseDirectiveDesc(StringRef, SMLoc);
|
||||
@ -345,7 +345,7 @@ public:
|
||||
}
|
||||
bool ParseSectionDirectiveIdent(StringRef, SMLoc) {
|
||||
// Darwin silently ignores the .ident directive.
|
||||
getParser().EatToEndOfStatement();
|
||||
getParser().eatToEndOfStatement();
|
||||
return false;
|
||||
}
|
||||
bool ParseSectionDirectiveThreadInitFunc(StringRef, SMLoc) {
|
||||
@ -390,7 +390,7 @@ bool DarwinAsmParser::ParseSectionSwitch(const char *Segment,
|
||||
/// ::= .desc identifier , expression
|
||||
bool DarwinAsmParser::ParseDirectiveDesc(StringRef, SMLoc) {
|
||||
StringRef Name;
|
||||
if (getParser().ParseIdentifier(Name))
|
||||
if (getParser().parseIdentifier(Name))
|
||||
return TokError("expected identifier in directive");
|
||||
|
||||
// Handle the identifier as the key symbol.
|
||||
@ -401,7 +401,7 @@ bool DarwinAsmParser::ParseDirectiveDesc(StringRef, SMLoc) {
|
||||
Lex();
|
||||
|
||||
int64_t DescValue;
|
||||
if (getParser().ParseAbsoluteExpression(DescValue))
|
||||
if (getParser().parseAbsoluteExpression(DescValue))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -447,7 +447,7 @@ bool DarwinAsmParser::ParseDirectiveLinkerOption(StringRef IDVal, SMLoc) {
|
||||
return TokError("expected string in '" + Twine(IDVal) + "' directive");
|
||||
|
||||
std::string Data;
|
||||
if (getParser().ParseEscapedString(Data))
|
||||
if (getParser().parseEscapedString(Data))
|
||||
return true;
|
||||
|
||||
Args.push_back(Data);
|
||||
@ -469,7 +469,7 @@ bool DarwinAsmParser::ParseDirectiveLinkerOption(StringRef IDVal, SMLoc) {
|
||||
/// ::= .lsym identifier , expression
|
||||
bool DarwinAsmParser::ParseDirectiveLsym(StringRef, SMLoc) {
|
||||
StringRef Name;
|
||||
if (getParser().ParseIdentifier(Name))
|
||||
if (getParser().parseIdentifier(Name))
|
||||
return TokError("expected identifier in directive");
|
||||
|
||||
// Handle the identifier as the key symbol.
|
||||
@ -480,7 +480,7 @@ bool DarwinAsmParser::ParseDirectiveLsym(StringRef, SMLoc) {
|
||||
Lex();
|
||||
|
||||
const MCExpr *Value;
|
||||
if (getParser().ParseExpression(Value))
|
||||
if (getParser().parseExpression(Value))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -501,7 +501,7 @@ bool DarwinAsmParser::ParseDirectiveSection(StringRef, SMLoc) {
|
||||
SMLoc Loc = getLexer().getLoc();
|
||||
|
||||
StringRef SectionName;
|
||||
if (getParser().ParseIdentifier(SectionName))
|
||||
if (getParser().parseIdentifier(SectionName))
|
||||
return Error(Loc, "expected identifier after '.section' directive");
|
||||
|
||||
// Verify there is a following comma.
|
||||
@ -576,7 +576,7 @@ bool DarwinAsmParser::ParseDirectivePrevious(StringRef DirName, SMLoc) {
|
||||
/// ParseDirectiveSecureLogUnique
|
||||
/// ::= .secure_log_unique ... message ...
|
||||
bool DarwinAsmParser::ParseDirectiveSecureLogUnique(StringRef, SMLoc IDLoc) {
|
||||
StringRef LogMessage = getParser().ParseStringToEndOfStatement();
|
||||
StringRef LogMessage = getParser().parseStringToEndOfStatement();
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
return TokError("unexpected token in '.secure_log_unique' directive");
|
||||
|
||||
@ -644,7 +644,7 @@ bool DarwinAsmParser::ParseDirectiveSubsectionsViaSymbols(StringRef, SMLoc) {
|
||||
bool DarwinAsmParser::ParseDirectiveTBSS(StringRef, SMLoc) {
|
||||
SMLoc IDLoc = getLexer().getLoc();
|
||||
StringRef Name;
|
||||
if (getParser().ParseIdentifier(Name))
|
||||
if (getParser().parseIdentifier(Name))
|
||||
return TokError("expected identifier in directive");
|
||||
|
||||
// Handle the identifier as the key symbol.
|
||||
@ -656,7 +656,7 @@ bool DarwinAsmParser::ParseDirectiveTBSS(StringRef, SMLoc) {
|
||||
|
||||
int64_t Size;
|
||||
SMLoc SizeLoc = getLexer().getLoc();
|
||||
if (getParser().ParseAbsoluteExpression(Size))
|
||||
if (getParser().parseAbsoluteExpression(Size))
|
||||
return true;
|
||||
|
||||
int64_t Pow2Alignment = 0;
|
||||
@ -664,7 +664,7 @@ bool DarwinAsmParser::ParseDirectiveTBSS(StringRef, SMLoc) {
|
||||
if (getLexer().is(AsmToken::Comma)) {
|
||||
Lex();
|
||||
Pow2AlignmentLoc = getLexer().getLoc();
|
||||
if (getParser().ParseAbsoluteExpression(Pow2Alignment))
|
||||
if (getParser().parseAbsoluteExpression(Pow2Alignment))
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -699,7 +699,7 @@ bool DarwinAsmParser::ParseDirectiveTBSS(StringRef, SMLoc) {
|
||||
/// , align_expression ]]
|
||||
bool DarwinAsmParser::ParseDirectiveZerofill(StringRef, SMLoc) {
|
||||
StringRef Segment;
|
||||
if (getParser().ParseIdentifier(Segment))
|
||||
if (getParser().parseIdentifier(Segment))
|
||||
return TokError("expected segment name after '.zerofill' directive");
|
||||
|
||||
if (getLexer().isNot(AsmToken::Comma))
|
||||
@ -707,7 +707,7 @@ bool DarwinAsmParser::ParseDirectiveZerofill(StringRef, SMLoc) {
|
||||
Lex();
|
||||
|
||||
StringRef Section;
|
||||
if (getParser().ParseIdentifier(Section))
|
||||
if (getParser().parseIdentifier(Section))
|
||||
return TokError("expected section name after comma in '.zerofill' "
|
||||
"directive");
|
||||
|
||||
@ -727,7 +727,7 @@ bool DarwinAsmParser::ParseDirectiveZerofill(StringRef, SMLoc) {
|
||||
|
||||
SMLoc IDLoc = getLexer().getLoc();
|
||||
StringRef IDStr;
|
||||
if (getParser().ParseIdentifier(IDStr))
|
||||
if (getParser().parseIdentifier(IDStr))
|
||||
return TokError("expected identifier in directive");
|
||||
|
||||
// handle the identifier as the key symbol.
|
||||
@ -739,7 +739,7 @@ bool DarwinAsmParser::ParseDirectiveZerofill(StringRef, SMLoc) {
|
||||
|
||||
int64_t Size;
|
||||
SMLoc SizeLoc = getLexer().getLoc();
|
||||
if (getParser().ParseAbsoluteExpression(Size))
|
||||
if (getParser().parseAbsoluteExpression(Size))
|
||||
return true;
|
||||
|
||||
int64_t Pow2Alignment = 0;
|
||||
@ -747,7 +747,7 @@ bool DarwinAsmParser::ParseDirectiveZerofill(StringRef, SMLoc) {
|
||||
if (getLexer().is(AsmToken::Comma)) {
|
||||
Lex();
|
||||
Pow2AlignmentLoc = getLexer().getLoc();
|
||||
if (getParser().ParseAbsoluteExpression(Pow2Alignment))
|
||||
if (getParser().parseAbsoluteExpression(Pow2Alignment))
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -791,7 +791,7 @@ bool DarwinAsmParser::ParseDirectiveDataRegion(StringRef, SMLoc) {
|
||||
}
|
||||
StringRef RegionType;
|
||||
SMLoc Loc = getParser().getTok().getLoc();
|
||||
if (getParser().ParseIdentifier(RegionType))
|
||||
if (getParser().parseIdentifier(RegionType))
|
||||
return TokError("expected region type after '.data_region' directive");
|
||||
int Kind = StringSwitch<int>(RegionType)
|
||||
.Case("jt8", MCDR_DataRegionJT8)
|
||||
|
@ -23,11 +23,11 @@ namespace {
|
||||
|
||||
class ELFAsmParser : public MCAsmParserExtension {
|
||||
template<bool (ELFAsmParser::*HandlerMethod)(StringRef, SMLoc)>
|
||||
void AddDirectiveHandler(StringRef Directive) {
|
||||
void addDirectiveHandler(StringRef Directive) {
|
||||
MCAsmParser::ExtensionDirectiveHandler Handler = std::make_pair(
|
||||
this, HandleDirective<ELFAsmParser, HandlerMethod>);
|
||||
|
||||
getParser().AddDirectiveHandler(Directive, Handler);
|
||||
getParser().addDirectiveHandler(Directive, Handler);
|
||||
}
|
||||
|
||||
bool ParseSectionSwitch(StringRef Section, unsigned Type,
|
||||
@ -43,38 +43,38 @@ public:
|
||||
// Call the base implementation.
|
||||
this->MCAsmParserExtension::Initialize(Parser);
|
||||
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveData>(".data");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveText>(".text");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveBSS>(".bss");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveRoData>(".rodata");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveTData>(".tdata");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveTBSS>(".tbss");
|
||||
AddDirectiveHandler<
|
||||
addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveData>(".data");
|
||||
addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveText>(".text");
|
||||
addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveBSS>(".bss");
|
||||
addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveRoData>(".rodata");
|
||||
addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveTData>(".tdata");
|
||||
addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveTBSS>(".tbss");
|
||||
addDirectiveHandler<
|
||||
&ELFAsmParser::ParseSectionDirectiveDataRel>(".data.rel");
|
||||
AddDirectiveHandler<
|
||||
addDirectiveHandler<
|
||||
&ELFAsmParser::ParseSectionDirectiveDataRelRo>(".data.rel.ro");
|
||||
AddDirectiveHandler<
|
||||
addDirectiveHandler<
|
||||
&ELFAsmParser::ParseSectionDirectiveDataRelRoLocal>(".data.rel.ro.local");
|
||||
AddDirectiveHandler<
|
||||
addDirectiveHandler<
|
||||
&ELFAsmParser::ParseSectionDirectiveEhFrame>(".eh_frame");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseDirectiveSection>(".section");
|
||||
AddDirectiveHandler<
|
||||
addDirectiveHandler<&ELFAsmParser::ParseDirectiveSection>(".section");
|
||||
addDirectiveHandler<
|
||||
&ELFAsmParser::ParseDirectivePushSection>(".pushsection");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseDirectivePopSection>(".popsection");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseDirectiveSize>(".size");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseDirectivePrevious>(".previous");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseDirectiveType>(".type");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseDirectiveIdent>(".ident");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseDirectiveSymver>(".symver");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseDirectiveVersion>(".version");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseDirectiveWeakref>(".weakref");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseDirectiveSymbolAttribute>(".weak");
|
||||
AddDirectiveHandler<&ELFAsmParser::ParseDirectiveSymbolAttribute>(".local");
|
||||
AddDirectiveHandler<
|
||||
addDirectiveHandler<&ELFAsmParser::ParseDirectivePopSection>(".popsection");
|
||||
addDirectiveHandler<&ELFAsmParser::ParseDirectiveSize>(".size");
|
||||
addDirectiveHandler<&ELFAsmParser::ParseDirectivePrevious>(".previous");
|
||||
addDirectiveHandler<&ELFAsmParser::ParseDirectiveType>(".type");
|
||||
addDirectiveHandler<&ELFAsmParser::ParseDirectiveIdent>(".ident");
|
||||
addDirectiveHandler<&ELFAsmParser::ParseDirectiveSymver>(".symver");
|
||||
addDirectiveHandler<&ELFAsmParser::ParseDirectiveVersion>(".version");
|
||||
addDirectiveHandler<&ELFAsmParser::ParseDirectiveWeakref>(".weakref");
|
||||
addDirectiveHandler<&ELFAsmParser::ParseDirectiveSymbolAttribute>(".weak");
|
||||
addDirectiveHandler<&ELFAsmParser::ParseDirectiveSymbolAttribute>(".local");
|
||||
addDirectiveHandler<
|
||||
&ELFAsmParser::ParseDirectiveSymbolAttribute>(".protected");
|
||||
AddDirectiveHandler<
|
||||
addDirectiveHandler<
|
||||
&ELFAsmParser::ParseDirectiveSymbolAttribute>(".internal");
|
||||
AddDirectiveHandler<
|
||||
addDirectiveHandler<
|
||||
&ELFAsmParser::ParseDirectiveSymbolAttribute>(".hidden");
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ bool ELFAsmParser::ParseDirectiveSymbolAttribute(StringRef Directive, SMLoc) {
|
||||
for (;;) {
|
||||
StringRef Name;
|
||||
|
||||
if (getParser().ParseIdentifier(Name))
|
||||
if (getParser().parseIdentifier(Name))
|
||||
return TokError("expected identifier in directive");
|
||||
|
||||
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name);
|
||||
@ -203,7 +203,7 @@ bool ELFAsmParser::ParseSectionSwitch(StringRef Section, unsigned Type,
|
||||
|
||||
bool ELFAsmParser::ParseDirectiveSize(StringRef, SMLoc) {
|
||||
StringRef Name;
|
||||
if (getParser().ParseIdentifier(Name))
|
||||
if (getParser().parseIdentifier(Name))
|
||||
return TokError("expected identifier in directive");
|
||||
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name);
|
||||
|
||||
@ -212,7 +212,7 @@ bool ELFAsmParser::ParseDirectiveSize(StringRef, SMLoc) {
|
||||
Lex();
|
||||
|
||||
const MCExpr *Expr;
|
||||
if (getParser().ParseExpression(Expr))
|
||||
if (getParser().parseExpression(Expr))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
@ -224,7 +224,7 @@ bool ELFAsmParser::ParseDirectiveSize(StringRef, SMLoc) {
|
||||
|
||||
bool ELFAsmParser::ParseSectionName(StringRef &SectionName) {
|
||||
// A section name can contain -, so we cannot just use
|
||||
// ParseIdentifier.
|
||||
// parseIdentifier.
|
||||
SMLoc FirstLoc = getLexer().getLoc();
|
||||
unsigned Size = 0;
|
||||
|
||||
@ -377,14 +377,14 @@ bool ELFAsmParser::ParseDirectiveSection(StringRef, SMLoc) {
|
||||
return TokError("expected '@' or '%' before type");
|
||||
|
||||
Lex();
|
||||
if (getParser().ParseIdentifier(TypeName))
|
||||
if (getParser().parseIdentifier(TypeName))
|
||||
return TokError("expected identifier in directive");
|
||||
|
||||
if (Mergeable) {
|
||||
if (getLexer().isNot(AsmToken::Comma))
|
||||
return TokError("expected the entry size");
|
||||
Lex();
|
||||
if (getParser().ParseAbsoluteExpression(Size))
|
||||
if (getParser().parseAbsoluteExpression(Size))
|
||||
return true;
|
||||
if (Size <= 0)
|
||||
return TokError("entry size must be positive");
|
||||
@ -394,12 +394,12 @@ bool ELFAsmParser::ParseDirectiveSection(StringRef, SMLoc) {
|
||||
if (getLexer().isNot(AsmToken::Comma))
|
||||
return TokError("expected group name");
|
||||
Lex();
|
||||
if (getParser().ParseIdentifier(GroupName))
|
||||
if (getParser().parseIdentifier(GroupName))
|
||||
return true;
|
||||
if (getLexer().is(AsmToken::Comma)) {
|
||||
Lex();
|
||||
StringRef Linkage;
|
||||
if (getParser().ParseIdentifier(Linkage))
|
||||
if (getParser().parseIdentifier(Linkage))
|
||||
return true;
|
||||
if (Linkage != "comdat")
|
||||
return TokError("Linkage must be 'comdat'");
|
||||
@ -461,7 +461,7 @@ bool ELFAsmParser::ParseDirectivePrevious(StringRef DirName, SMLoc) {
|
||||
/// ::= .type identifier , @attribute
|
||||
bool ELFAsmParser::ParseDirectiveType(StringRef, SMLoc) {
|
||||
StringRef Name;
|
||||
if (getParser().ParseIdentifier(Name))
|
||||
if (getParser().parseIdentifier(Name))
|
||||
return TokError("expected identifier in directive");
|
||||
|
||||
// Handle the identifier as the key symbol.
|
||||
@ -479,7 +479,7 @@ bool ELFAsmParser::ParseDirectiveType(StringRef, SMLoc) {
|
||||
SMLoc TypeLoc;
|
||||
|
||||
TypeLoc = getLexer().getLoc();
|
||||
if (getParser().ParseIdentifier(Type))
|
||||
if (getParser().parseIdentifier(Type))
|
||||
return TokError("expected symbol type in directive");
|
||||
|
||||
MCSymbolAttr Attr = StringSwitch<MCSymbolAttr>(Type)
|
||||
@ -538,7 +538,7 @@ bool ELFAsmParser::ParseDirectiveIdent(StringRef, SMLoc) {
|
||||
/// ::= .symver foo, bar2@zed
|
||||
bool ELFAsmParser::ParseDirectiveSymver(StringRef, SMLoc) {
|
||||
StringRef Name;
|
||||
if (getParser().ParseIdentifier(Name))
|
||||
if (getParser().parseIdentifier(Name))
|
||||
return TokError("expected identifier in directive");
|
||||
|
||||
if (getLexer().isNot(AsmToken::Comma))
|
||||
@ -547,7 +547,7 @@ bool ELFAsmParser::ParseDirectiveSymver(StringRef, SMLoc) {
|
||||
Lex();
|
||||
|
||||
StringRef AliasName;
|
||||
if (getParser().ParseIdentifier(AliasName))
|
||||
if (getParser().parseIdentifier(AliasName))
|
||||
return TokError("expected identifier in directive");
|
||||
|
||||
if (AliasName.find('@') == StringRef::npos)
|
||||
@ -593,7 +593,7 @@ bool ELFAsmParser::ParseDirectiveWeakref(StringRef, SMLoc) {
|
||||
// FIXME: Share code with the other alias building directives.
|
||||
|
||||
StringRef AliasName;
|
||||
if (getParser().ParseIdentifier(AliasName))
|
||||
if (getParser().parseIdentifier(AliasName))
|
||||
return TokError("expected identifier in directive");
|
||||
|
||||
if (getLexer().isNot(AsmToken::Comma))
|
||||
@ -602,7 +602,7 @@ bool ELFAsmParser::ParseDirectiveWeakref(StringRef, SMLoc) {
|
||||
Lex();
|
||||
|
||||
StringRef Name;
|
||||
if (getParser().ParseIdentifier(Name))
|
||||
if (getParser().parseIdentifier(Name))
|
||||
return TokError("expected identifier in directive");
|
||||
|
||||
MCSymbol *Alias = getContext().GetOrCreateSymbol(AliasName);
|
||||
|
@ -38,9 +38,9 @@ bool MCAsmParser::TokError(const Twine &Msg, ArrayRef<SMRange> Ranges) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MCAsmParser::ParseExpression(const MCExpr *&Res) {
|
||||
bool MCAsmParser::parseExpression(const MCExpr *&Res) {
|
||||
SMLoc L;
|
||||
return ParseExpression(Res, L);
|
||||
return parseExpression(Res, L);
|
||||
}
|
||||
|
||||
void MCParsedAsmOperand::dump() const {
|
||||
|
@ -1155,7 +1155,7 @@ AArch64AsmParser::ParseImmediate(const MCExpr *&ExprVal) {
|
||||
return ResTy;
|
||||
|
||||
const MCExpr *SubExprVal;
|
||||
if (getParser().ParseExpression(SubExprVal))
|
||||
if (getParser().parseExpression(SubExprVal))
|
||||
return MatchOperand_ParseFail;
|
||||
|
||||
ExprVal = AArch64MCExpr::Create(RefKind, SubExprVal, getContext());
|
||||
@ -1163,7 +1163,7 @@ AArch64AsmParser::ParseImmediate(const MCExpr *&ExprVal) {
|
||||
}
|
||||
|
||||
// No weird AArch64MCExpr prefix
|
||||
return getParser().ParseExpression(ExprVal)
|
||||
return getParser().parseExpression(ExprVal)
|
||||
? MatchOperand_ParseFail : MatchOperand_Success;
|
||||
}
|
||||
|
||||
@ -1823,7 +1823,7 @@ bool AArch64AsmParser::ParseInstruction(ParseInstructionInfo &Info,
|
||||
|
||||
if (Code == A64CC::Invalid) {
|
||||
Error(S, "invalid condition code");
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1838,7 +1838,7 @@ bool AArch64AsmParser::ParseInstruction(ParseInstructionInfo &Info,
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
// Read the first operand.
|
||||
if (ParseOperand(Operands, Mnemonic)) {
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1847,7 +1847,7 @@ bool AArch64AsmParser::ParseInstruction(ParseInstructionInfo &Info,
|
||||
|
||||
// Parse and remember the operand.
|
||||
if (ParseOperand(Operands, Mnemonic)) {
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1876,7 +1876,7 @@ bool AArch64AsmParser::ParseInstruction(ParseInstructionInfo &Info,
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
SMLoc Loc = getLexer().getLoc();
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(Loc, "expected comma before next operand");
|
||||
}
|
||||
|
||||
@ -1906,7 +1906,7 @@ bool AArch64AsmParser::ParseDirectiveWord(unsigned Size, SMLoc L) {
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
for (;;) {
|
||||
const MCExpr *Value;
|
||||
if (getParser().ParseExpression(Value))
|
||||
if (getParser().parseExpression(Value))
|
||||
return true;
|
||||
|
||||
getParser().getStreamer().EmitValue(Value, Size, 0/*addrspace*/);
|
||||
@ -1929,7 +1929,7 @@ bool AArch64AsmParser::ParseDirectiveWord(unsigned Size, SMLoc L) {
|
||||
// ::= .tlsdesccall symbol
|
||||
bool AArch64AsmParser::ParseDirectiveTLSDescCall(SMLoc L) {
|
||||
StringRef Name;
|
||||
if (getParser().ParseIdentifier(Name))
|
||||
if (getParser().parseIdentifier(Name))
|
||||
return Error(L, "expected symbol after directive");
|
||||
|
||||
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name);
|
||||
|
@ -2568,7 +2568,7 @@ int ARMAsmParser::tryParseShiftRegister(
|
||||
Parser.Lex(); // Eat hash.
|
||||
SMLoc ImmLoc = Parser.getTok().getLoc();
|
||||
const MCExpr *ShiftExpr = 0;
|
||||
if (getParser().ParseExpression(ShiftExpr, EndLoc)) {
|
||||
if (getParser().parseExpression(ShiftExpr, EndLoc)) {
|
||||
Error(ImmLoc, "invalid immediate shift value");
|
||||
return -1;
|
||||
}
|
||||
@ -2651,7 +2651,7 @@ tryParseRegisterWithWriteBack(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||
Parser.Lex(); // Eat left bracket token.
|
||||
|
||||
const MCExpr *ImmVal;
|
||||
if (getParser().ParseExpression(ImmVal))
|
||||
if (getParser().parseExpression(ImmVal))
|
||||
return true;
|
||||
const MCConstantExpr *MCE = dyn_cast<MCConstantExpr>(ImmVal);
|
||||
if (!MCE)
|
||||
@ -2796,7 +2796,7 @@ parseCoprocOptionOperand(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||
|
||||
const MCExpr *Expr;
|
||||
SMLoc Loc = Parser.getTok().getLoc();
|
||||
if (getParser().ParseExpression(Expr)) {
|
||||
if (getParser().parseExpression(Expr)) {
|
||||
Error(Loc, "illegal expression");
|
||||
return MatchOperand_ParseFail;
|
||||
}
|
||||
@ -3009,7 +3009,7 @@ parseVectorLane(VectorLaneTy &LaneKind, unsigned &Index, SMLoc &EndLoc) {
|
||||
|
||||
const MCExpr *LaneIndex;
|
||||
SMLoc Loc = Parser.getTok().getLoc();
|
||||
if (getParser().ParseExpression(LaneIndex)) {
|
||||
if (getParser().parseExpression(LaneIndex)) {
|
||||
Error(Loc, "illegal expression");
|
||||
return MatchOperand_ParseFail;
|
||||
}
|
||||
@ -3327,7 +3327,7 @@ parseMemBarrierOptOperand(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||
SMLoc Loc = Parser.getTok().getLoc();
|
||||
|
||||
const MCExpr *MemBarrierID;
|
||||
if (getParser().ParseExpression(MemBarrierID)) {
|
||||
if (getParser().parseExpression(MemBarrierID)) {
|
||||
Error(Loc, "illegal expression");
|
||||
return MatchOperand_ParseFail;
|
||||
}
|
||||
@ -3543,7 +3543,7 @@ parsePKHImm(SmallVectorImpl<MCParsedAsmOperand*> &Operands, StringRef Op,
|
||||
const MCExpr *ShiftAmount;
|
||||
SMLoc Loc = Parser.getTok().getLoc();
|
||||
SMLoc EndLoc;
|
||||
if (getParser().ParseExpression(ShiftAmount, EndLoc)) {
|
||||
if (getParser().parseExpression(ShiftAmount, EndLoc)) {
|
||||
Error(Loc, "illegal expression");
|
||||
return MatchOperand_ParseFail;
|
||||
}
|
||||
@ -3623,7 +3623,7 @@ parseShifterImm(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||
|
||||
const MCExpr *ShiftAmount;
|
||||
SMLoc EndLoc;
|
||||
if (getParser().ParseExpression(ShiftAmount, EndLoc)) {
|
||||
if (getParser().parseExpression(ShiftAmount, EndLoc)) {
|
||||
Error(ExLoc, "malformed shift expression");
|
||||
return MatchOperand_ParseFail;
|
||||
}
|
||||
@ -3684,7 +3684,7 @@ parseRotImm(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||
|
||||
const MCExpr *ShiftAmount;
|
||||
SMLoc EndLoc;
|
||||
if (getParser().ParseExpression(ShiftAmount, EndLoc)) {
|
||||
if (getParser().parseExpression(ShiftAmount, EndLoc)) {
|
||||
Error(ExLoc, "malformed rotate expression");
|
||||
return MatchOperand_ParseFail;
|
||||
}
|
||||
@ -3721,7 +3721,7 @@ parseBitfield(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||
|
||||
const MCExpr *LSBExpr;
|
||||
SMLoc E = Parser.getTok().getLoc();
|
||||
if (getParser().ParseExpression(LSBExpr)) {
|
||||
if (getParser().parseExpression(LSBExpr)) {
|
||||
Error(E, "malformed immediate expression");
|
||||
return MatchOperand_ParseFail;
|
||||
}
|
||||
@ -3754,7 +3754,7 @@ parseBitfield(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||
|
||||
const MCExpr *WidthExpr;
|
||||
SMLoc EndLoc;
|
||||
if (getParser().ParseExpression(WidthExpr, EndLoc)) {
|
||||
if (getParser().parseExpression(WidthExpr, EndLoc)) {
|
||||
Error(E, "malformed immediate expression");
|
||||
return MatchOperand_ParseFail;
|
||||
}
|
||||
@ -3850,7 +3850,7 @@ parseAM3Offset(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||
bool isNegative = Parser.getTok().is(AsmToken::Minus);
|
||||
const MCExpr *Offset;
|
||||
SMLoc E;
|
||||
if (getParser().ParseExpression(Offset, E))
|
||||
if (getParser().parseExpression(Offset, E))
|
||||
return MatchOperand_ParseFail;
|
||||
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(Offset);
|
||||
if (!CE) {
|
||||
@ -4272,7 +4272,7 @@ parseMemory(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||
E = Parser.getTok().getLoc();
|
||||
|
||||
const MCExpr *Expr;
|
||||
if (getParser().ParseExpression(Expr))
|
||||
if (getParser().parseExpression(Expr))
|
||||
return true;
|
||||
|
||||
// The expression has to be a constant. Memory references with relocations
|
||||
@ -4328,7 +4328,7 @@ parseMemory(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||
|
||||
bool isNegative = getParser().getTok().is(AsmToken::Minus);
|
||||
const MCExpr *Offset;
|
||||
if (getParser().ParseExpression(Offset))
|
||||
if (getParser().parseExpression(Offset))
|
||||
return true;
|
||||
|
||||
// The expression has to be a constant. Memory references with relocations
|
||||
@ -4447,7 +4447,7 @@ bool ARMAsmParser::parseMemRegOffsetShift(ARM_AM::ShiftOpc &St,
|
||||
Parser.Lex(); // Eat hash token.
|
||||
|
||||
const MCExpr *Expr;
|
||||
if (getParser().ParseExpression(Expr))
|
||||
if (getParser().parseExpression(Expr))
|
||||
return true;
|
||||
// Range check the immediate.
|
||||
// lsl, ror: 0 <= imm <= 31
|
||||
@ -4476,7 +4476,7 @@ bool ARMAsmParser::parseMemRegOffsetShift(ARM_AM::ShiftOpc &St,
|
||||
ARMAsmParser::OperandMatchResultTy ARMAsmParser::
|
||||
parseFPImm(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||
// Anything that can accept a floating point constant as an operand
|
||||
// needs to go through here, as the regular ParseExpression is
|
||||
// needs to go through here, as the regular parseExpression is
|
||||
// integer only.
|
||||
//
|
||||
// This routine still creates a generic Immediate operand, containing
|
||||
@ -4596,7 +4596,7 @@ bool ARMAsmParser::parseOperand(SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||
// identifier (like labels) as expressions and create them as immediates.
|
||||
const MCExpr *IdVal;
|
||||
S = Parser.getTok().getLoc();
|
||||
if (getParser().ParseExpression(IdVal))
|
||||
if (getParser().parseExpression(IdVal))
|
||||
return true;
|
||||
E = SMLoc::getFromPointer(Parser.getTok().getLoc().getPointer() - 1);
|
||||
Operands.push_back(ARMOperand::CreateImm(IdVal, S, E));
|
||||
@ -4615,7 +4615,7 @@ bool ARMAsmParser::parseOperand(SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||
if (Parser.getTok().isNot(AsmToken::Colon)) {
|
||||
bool isNegative = Parser.getTok().is(AsmToken::Minus);
|
||||
const MCExpr *ImmVal;
|
||||
if (getParser().ParseExpression(ImmVal))
|
||||
if (getParser().parseExpression(ImmVal))
|
||||
return true;
|
||||
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(ImmVal);
|
||||
if (CE) {
|
||||
@ -4639,7 +4639,7 @@ bool ARMAsmParser::parseOperand(SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||
return true;
|
||||
|
||||
const MCExpr *SubExprVal;
|
||||
if (getParser().ParseExpression(SubExprVal))
|
||||
if (getParser().parseExpression(SubExprVal))
|
||||
return true;
|
||||
|
||||
const MCExpr *ExprVal = ARMMCExpr::Create(RefKind, SubExprVal,
|
||||
@ -5012,7 +5012,7 @@ bool ARMAsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
|
||||
|
||||
// In Thumb1, only the branch (B) instruction can be predicated.
|
||||
if (isThumbOne() && PredicationCode != ARMCC::AL && Mnemonic != "b") {
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(NameLoc, "conditional execution not supported in Thumb1");
|
||||
}
|
||||
|
||||
@ -5026,14 +5026,14 @@ bool ARMAsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
|
||||
if (Mnemonic == "it") {
|
||||
SMLoc Loc = SMLoc::getFromPointer(NameLoc.getPointer() + 2);
|
||||
if (ITMask.size() > 3) {
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(Loc, "too many conditions on IT instruction");
|
||||
}
|
||||
unsigned Mask = 8;
|
||||
for (unsigned i = ITMask.size(); i != 0; --i) {
|
||||
char pos = ITMask[i - 1];
|
||||
if (pos != 't' && pos != 'e') {
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(Loc, "illegal IT block condition mask '" + ITMask + "'");
|
||||
}
|
||||
Mask >>= 1;
|
||||
@ -5059,14 +5059,14 @@ bool ARMAsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
|
||||
// If we had a carry-set on an instruction that can't do that, issue an
|
||||
// error.
|
||||
if (!CanAcceptCarrySet && CarrySetting) {
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(NameLoc, "instruction '" + Mnemonic +
|
||||
"' can not set flags, but 's' suffix specified");
|
||||
}
|
||||
// If we had a predication code on an instruction that can't do that, issue an
|
||||
// error.
|
||||
if (!CanAcceptPredicationCode && PredicationCode != ARMCC::AL) {
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(NameLoc, "instruction '" + Mnemonic +
|
||||
"' is not predicable, but condition code specified");
|
||||
}
|
||||
@ -5115,7 +5115,7 @@ bool ARMAsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
// Read the first operand.
|
||||
if (parseOperand(Operands, Mnemonic)) {
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -5124,7 +5124,7 @@ bool ARMAsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
|
||||
|
||||
// Parse and remember the operand.
|
||||
if (parseOperand(Operands, Mnemonic)) {
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -5132,7 +5132,7 @@ bool ARMAsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
SMLoc Loc = getLexer().getLoc();
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(Loc, "unexpected token in argument list");
|
||||
}
|
||||
|
||||
@ -7614,7 +7614,7 @@ bool ARMAsmParser::parseDirectiveWord(unsigned Size, SMLoc L) {
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
for (;;) {
|
||||
const MCExpr *Value;
|
||||
if (getParser().ParseExpression(Value))
|
||||
if (getParser().parseExpression(Value))
|
||||
return true;
|
||||
|
||||
getParser().getStreamer().EmitValue(Value, Size);
|
||||
@ -7761,13 +7761,13 @@ bool ARMAsmParser::parseDirectiveReq(StringRef Name, SMLoc L) {
|
||||
unsigned Reg;
|
||||
SMLoc SRegLoc, ERegLoc;
|
||||
if (ParseRegister(Reg, SRegLoc, ERegLoc)) {
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(SRegLoc, "register name expected");
|
||||
}
|
||||
|
||||
// Shouldn't be anything else.
|
||||
if (Parser.getTok().isNot(AsmToken::EndOfStatement)) {
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(Parser.getTok().getLoc(),
|
||||
"unexpected input in .req directive.");
|
||||
}
|
||||
@ -7785,7 +7785,7 @@ bool ARMAsmParser::parseDirectiveReq(StringRef Name, SMLoc L) {
|
||||
/// ::= .unreq registername
|
||||
bool ARMAsmParser::parseDirectiveUnreq(SMLoc L) {
|
||||
if (Parser.getTok().isNot(AsmToken::Identifier)) {
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(L, "unexpected input in .unreq directive.");
|
||||
}
|
||||
RegisterReqs.erase(Parser.getTok().getIdentifier());
|
||||
|
@ -451,7 +451,7 @@ MBlazeOperand *MBlazeAsmParser::ParseImmediate() {
|
||||
case AsmToken::Minus:
|
||||
case AsmToken::Integer:
|
||||
case AsmToken::Identifier:
|
||||
if (getParser().ParseExpression(EVal))
|
||||
if (getParser().parseExpression(EVal))
|
||||
return 0;
|
||||
|
||||
return MBlazeOperand::CreateImm(EVal, S, E);
|
||||
@ -537,7 +537,7 @@ bool MBlazeAsmParser::ParseDirectiveWord(unsigned Size, SMLoc L) {
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
for (;;) {
|
||||
const MCExpr *Value;
|
||||
if (getParser().ParseExpression(Value))
|
||||
if (getParser().parseExpression(Value))
|
||||
return true;
|
||||
|
||||
getParser().getStreamer().EmitValue(Value, Size);
|
||||
|
@ -811,7 +811,7 @@ bool MipsAsmParser::ParseOperand(SmallVectorImpl<MCParsedAsmOperand*>&Operands,
|
||||
}
|
||||
// maybe it is a symbol reference
|
||||
StringRef Identifier;
|
||||
if (Parser.ParseIdentifier(Identifier))
|
||||
if (Parser.parseIdentifier(Identifier))
|
||||
return true;
|
||||
|
||||
SMLoc E = SMLoc::getFromPointer(Parser.getTok().getLoc().getPointer() - 1);
|
||||
@ -834,7 +834,7 @@ bool MipsAsmParser::ParseOperand(SmallVectorImpl<MCParsedAsmOperand*>&Operands,
|
||||
// quoted label names
|
||||
const MCExpr *IdVal;
|
||||
SMLoc S = Parser.getTok().getLoc();
|
||||
if (getParser().ParseExpression(IdVal))
|
||||
if (getParser().parseExpression(IdVal))
|
||||
return true;
|
||||
SMLoc E = SMLoc::getFromPointer(Parser.getTok().getLoc().getPointer() - 1);
|
||||
Operands.push_back(MipsOperand::CreateImm(IdVal, S, E));
|
||||
@ -886,7 +886,7 @@ bool MipsAsmParser::parseRelocOperand(const MCExpr *&Res) {
|
||||
} else
|
||||
break;
|
||||
}
|
||||
if (getParser().ParseParenExpression(IdVal,EndLoc))
|
||||
if (getParser().parseParenExpression(IdVal,EndLoc))
|
||||
return true;
|
||||
|
||||
while (getLexer().getKind() == AsmToken::RParen)
|
||||
@ -937,7 +937,7 @@ bool MipsAsmParser::parseMemOffset(const MCExpr *&Res) {
|
||||
case AsmToken::Integer:
|
||||
case AsmToken::Minus:
|
||||
case AsmToken::Plus:
|
||||
return (getParser().ParseExpression(Res));
|
||||
return (getParser().parseExpression(Res));
|
||||
case AsmToken::Percent:
|
||||
return parseRelocOperand(Res);
|
||||
case AsmToken::LParen:
|
||||
@ -1203,13 +1203,13 @@ parseMathOperation(StringRef Name, SMLoc NameLoc,
|
||||
// Read the first operand.
|
||||
if (ParseOperand(Operands, Name)) {
|
||||
SMLoc Loc = getLexer().getLoc();
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(Loc, "unexpected token in argument list");
|
||||
}
|
||||
|
||||
if (getLexer().isNot(AsmToken::Comma)) {
|
||||
SMLoc Loc = getLexer().getLoc();
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(Loc, "unexpected token in argument list");
|
||||
|
||||
}
|
||||
@ -1221,14 +1221,14 @@ parseMathOperation(StringRef Name, SMLoc NameLoc,
|
||||
// Parse and remember the operand.
|
||||
if (ParseOperand(Operands, Name)) {
|
||||
SMLoc Loc = getLexer().getLoc();
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(Loc, "unexpected token in argument list");
|
||||
}
|
||||
}
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
SMLoc Loc = getLexer().getLoc();
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(Loc, "unexpected token in argument list");
|
||||
}
|
||||
|
||||
@ -1290,7 +1290,7 @@ ParseInstruction(ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc,
|
||||
// Read the first operand.
|
||||
if (ParseOperand(Operands, Name)) {
|
||||
SMLoc Loc = getLexer().getLoc();
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(Loc, "unexpected token in argument list");
|
||||
}
|
||||
|
||||
@ -1300,7 +1300,7 @@ ParseInstruction(ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc,
|
||||
// Parse and remember the operand.
|
||||
if (ParseOperand(Operands, Name)) {
|
||||
SMLoc Loc = getLexer().getLoc();
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(Loc, "unexpected token in argument list");
|
||||
}
|
||||
}
|
||||
@ -1308,7 +1308,7 @@ ParseInstruction(ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc,
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
SMLoc Loc = getLexer().getLoc();
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(Loc, "unexpected token in argument list");
|
||||
}
|
||||
|
||||
@ -1318,7 +1318,7 @@ ParseInstruction(ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc,
|
||||
|
||||
bool MipsAsmParser::reportParseError(StringRef ErrorMsg) {
|
||||
SMLoc Loc = getLexer().getLoc();
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(Loc, ErrorMsg);
|
||||
}
|
||||
|
||||
@ -1446,11 +1446,11 @@ bool MipsAsmParser::parseDirectiveSet() {
|
||||
return parseSetNoMacroDirective();
|
||||
} else if (Tok.getString() == "nomips16") {
|
||||
// ignore this directive for now
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return false;
|
||||
} else if (Tok.getString() == "nomicromips") {
|
||||
// ignore this directive for now
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1463,7 +1463,7 @@ bool MipsAsmParser::parseDirectiveWord(unsigned Size, SMLoc L) {
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
for (;;) {
|
||||
const MCExpr *Value;
|
||||
if (getParser().ParseExpression(Value))
|
||||
if (getParser().parseExpression(Value))
|
||||
return true;
|
||||
|
||||
getParser().getStreamer().EmitValue(Value, Size);
|
||||
@ -1500,7 +1500,7 @@ bool MipsAsmParser::ParseDirective(AsmToken DirectiveID) {
|
||||
|
||||
if (IDVal == ".frame") {
|
||||
// ignore this directive for now
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1510,19 +1510,19 @@ bool MipsAsmParser::ParseDirective(AsmToken DirectiveID) {
|
||||
|
||||
if (IDVal == ".fmask") {
|
||||
// ignore this directive for now
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (IDVal == ".mask") {
|
||||
// ignore this directive for now
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (IDVal == ".gpword") {
|
||||
// ignore this directive for now
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -906,7 +906,7 @@ X86Operand *X86AsmParser::ParseIntelBracExpression(unsigned SegReg,
|
||||
if (getLexer().is(AsmToken::Identifier)) {
|
||||
if (ParseRegister(TmpReg, Start, End)) {
|
||||
const MCExpr *Disp;
|
||||
if (getParser().ParseExpression(Disp, End))
|
||||
if (getParser().parseExpression(Disp, End))
|
||||
return 0;
|
||||
|
||||
if (getLexer().isNot(AsmToken::RBrac))
|
||||
@ -951,7 +951,7 @@ X86Operand *X86AsmParser::ParseIntelBracExpression(unsigned SegReg,
|
||||
SM.onRegister(TmpReg);
|
||||
UpdateLocLex = false;
|
||||
break;
|
||||
} else if (!getParser().ParseExpression(Disp, End)) {
|
||||
} else if (!getParser().parseExpression(Disp, End)) {
|
||||
SM.onDispExpr();
|
||||
UpdateLocLex = false;
|
||||
break;
|
||||
@ -1033,7 +1033,7 @@ X86Operand *X86AsmParser::ParseIntelMemOperand(unsigned SegReg, SMLoc Start) {
|
||||
}
|
||||
|
||||
const MCExpr *Disp = MCConstantExpr::Create(0, getParser().getContext());
|
||||
if (getParser().ParseExpression(Disp, End))
|
||||
if (getParser().parseExpression(Disp, End))
|
||||
return 0;
|
||||
|
||||
bool NeedSizeDir = false;
|
||||
@ -1135,7 +1135,7 @@ X86Operand *X86AsmParser::ParseIntelOffsetOfOperator(SMLoc Start) {
|
||||
|
||||
SMLoc End;
|
||||
const MCExpr *Val;
|
||||
if (getParser().ParseExpression(Val, End))
|
||||
if (getParser().parseExpression(Val, End))
|
||||
return ErrorOperand(Start, "Unable to parse expression!");
|
||||
|
||||
// Don't emit the offset operator.
|
||||
@ -1169,7 +1169,7 @@ X86Operand *X86AsmParser::ParseIntelOperator(SMLoc Start, unsigned OpKind) {
|
||||
|
||||
SMLoc End;
|
||||
const MCExpr *Val;
|
||||
if (getParser().ParseExpression(Val, End))
|
||||
if (getParser().parseExpression(Val, End))
|
||||
return 0;
|
||||
|
||||
unsigned Length = 0, Size = 0, Type = 0;
|
||||
@ -1220,7 +1220,7 @@ X86Operand *X86AsmParser::ParseIntelOperand() {
|
||||
if (getLexer().is(AsmToken::Integer) || getLexer().is(AsmToken::Real) ||
|
||||
getLexer().is(AsmToken::Minus)) {
|
||||
const MCExpr *Val;
|
||||
if (!getParser().ParseExpression(Val, End)) {
|
||||
if (!getParser().parseExpression(Val, End)) {
|
||||
return X86Operand::CreateImm(Val, Start, End);
|
||||
}
|
||||
}
|
||||
@ -1271,7 +1271,7 @@ X86Operand *X86AsmParser::ParseATTOperand() {
|
||||
SMLoc Start = Parser.getTok().getLoc(), End;
|
||||
Parser.Lex();
|
||||
const MCExpr *Val;
|
||||
if (getParser().ParseExpression(Val, End))
|
||||
if (getParser().parseExpression(Val, End))
|
||||
return 0;
|
||||
return X86Operand::CreateImm(Val, Start, End);
|
||||
}
|
||||
@ -1289,7 +1289,7 @@ X86Operand *X86AsmParser::ParseMemOperand(unsigned SegReg, SMLoc MemStart) {
|
||||
const MCExpr *Disp = MCConstantExpr::Create(0, getParser().getContext());
|
||||
if (getLexer().isNot(AsmToken::LParen)) {
|
||||
SMLoc ExprEnd;
|
||||
if (getParser().ParseExpression(Disp, ExprEnd)) return 0;
|
||||
if (getParser().parseExpression(Disp, ExprEnd)) return 0;
|
||||
|
||||
// After parsing the base expression we could either have a parenthesized
|
||||
// memory address or not. If not, return now. If so, eat the (.
|
||||
@ -1315,7 +1315,7 @@ X86Operand *X86AsmParser::ParseMemOperand(unsigned SegReg, SMLoc MemStart) {
|
||||
SMLoc ExprEnd;
|
||||
|
||||
// It must be an parenthesized expression, parse it now.
|
||||
if (getParser().ParseParenExpression(Disp, ExprEnd))
|
||||
if (getParser().parseParenExpression(Disp, ExprEnd))
|
||||
return 0;
|
||||
|
||||
// After parsing the base expression we could either have a parenthesized
|
||||
@ -1375,7 +1375,7 @@ X86Operand *X86AsmParser::ParseMemOperand(unsigned SegReg, SMLoc MemStart) {
|
||||
SMLoc Loc = Parser.getTok().getLoc();
|
||||
|
||||
int64_t ScaleVal;
|
||||
if (getParser().ParseAbsoluteExpression(ScaleVal)){
|
||||
if (getParser().parseAbsoluteExpression(ScaleVal)){
|
||||
Error(Loc, "expected scale expression");
|
||||
return 0;
|
||||
}
|
||||
@ -1394,7 +1394,7 @@ X86Operand *X86AsmParser::ParseMemOperand(unsigned SegReg, SMLoc MemStart) {
|
||||
SMLoc Loc = Parser.getTok().getLoc();
|
||||
|
||||
int64_t Value;
|
||||
if (getParser().ParseAbsoluteExpression(Value))
|
||||
if (getParser().parseAbsoluteExpression(Value))
|
||||
return 0;
|
||||
|
||||
if (Value != 1)
|
||||
@ -1535,7 +1535,7 @@ ParseInstruction(ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc,
|
||||
if (X86Operand *Op = ParseOperand())
|
||||
Operands.push_back(Op);
|
||||
else {
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1546,14 +1546,14 @@ ParseInstruction(ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc,
|
||||
if (X86Operand *Op = ParseOperand())
|
||||
Operands.push_back(Op);
|
||||
else {
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
SMLoc Loc = getLexer().getLoc();
|
||||
Parser.EatToEndOfStatement();
|
||||
Parser.eatToEndOfStatement();
|
||||
return Error(Loc, "unexpected token in argument list");
|
||||
}
|
||||
}
|
||||
@ -2243,7 +2243,7 @@ bool X86AsmParser::ParseDirectiveWord(unsigned Size, SMLoc L) {
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
for (;;) {
|
||||
const MCExpr *Value;
|
||||
if (getParser().ParseExpression(Value))
|
||||
if (getParser().parseExpression(Value))
|
||||
return true;
|
||||
|
||||
getParser().getStreamer().EmitValue(Value, Size);
|
||||
|
Loading…
x
Reference in New Issue
Block a user