mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
[mips] Add assembler support for .set mips0 directive.
Summary: This directive is used to reset the assembler options to their initial values. Assembly programmers use it in conjunction with the ".set mipsX" directives. This patch depends on the .set push/pop directive (http://reviews.llvm.org/D4821). Contains work done by Matheus Almeida. Reviewers: dsanders Reviewed By: dsanders Differential Revision: http://reviews.llvm.org/D4957 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217438 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -177,6 +177,7 @@ class MipsAsmParser : public MCTargetAsmParser {
|
||||
const MCExpr *evaluateRelocExpr(const MCExpr *Expr, StringRef RelocStr);
|
||||
|
||||
bool isEvaluated(const MCExpr *Expr);
|
||||
bool parseSetMips0Directive();
|
||||
bool parseSetArchDirective();
|
||||
bool parseSetFeature(uint64_t Feature);
|
||||
bool parseDirectiveCPLoad(SMLoc Loc);
|
||||
@@ -2731,6 +2732,19 @@ bool MipsAsmParser::parseSetAssignment() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MipsAsmParser::parseSetMips0Directive() {
|
||||
Parser.Lex();
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
return reportParseError("unexpected token, expected end of statement");
|
||||
|
||||
// Reset assembler options to their initial values.
|
||||
setAvailableFeatures(AssemblerOptions.front()->getFeatures());
|
||||
AssemblerOptions.back()->setFeatures(AssemblerOptions.front()->getFeatures());
|
||||
|
||||
getTargetStreamer().emitDirectiveSetMips0();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MipsAsmParser::parseSetArchDirective() {
|
||||
Parser.Lex();
|
||||
if (getLexer().isNot(AsmToken::Equal))
|
||||
@@ -2981,6 +2995,8 @@ bool MipsAsmParser::parseDirectiveSet() {
|
||||
return false;
|
||||
} else if (Tok.getString() == "micromips") {
|
||||
return parseSetFeature(Mips::FeatureMicroMips);
|
||||
} else if (Tok.getString() == "mips0") {
|
||||
return parseSetMips0Directive();
|
||||
} else if (Tok.getString() == "mips1") {
|
||||
return parseSetFeature(Mips::FeatureMips1);
|
||||
} else if (Tok.getString() == "mips2") {
|
||||
|
||||
Reference in New Issue
Block a user