mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
[mips] [IAS] Add missing constraints and improve testing for the .module directive.
Summary: None of the .set directives can be used before the .module directives. The .set mips0/pop/push were not triggering this constraint. Also added testing for all the other implemented directives which are supposed to trigger this constraint. Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7140 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231465 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -236,6 +236,8 @@ class MipsAsmParser : public MCTargetAsmParser {
|
||||
bool parseFpABIValue(MipsABIFlagsSection::FpABIKind &FpABI,
|
||||
StringRef Directive);
|
||||
|
||||
bool parseInternalDirectiveReallowModule();
|
||||
|
||||
MCSymbolRefExpr::VariantKind getVariantKind(StringRef Symbol);
|
||||
|
||||
bool eatComma(StringRef ErrorStr);
|
||||
@@ -4429,9 +4431,25 @@ bool MipsAsmParser::ParseDirective(AsmToken DirectiveID) {
|
||||
if (IDVal == ".module")
|
||||
return parseDirectiveModule();
|
||||
|
||||
if (IDVal == ".llvm_internal_mips_reallow_module_directive")
|
||||
return parseInternalDirectiveReallowModule();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MipsAsmParser::parseInternalDirectiveReallowModule() {
|
||||
// If this is not the end of the statement, report an error.
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
reportParseError("unexpected token, expected end of statement");
|
||||
return false;
|
||||
}
|
||||
|
||||
getTargetStreamer().reallowModuleDirective();
|
||||
|
||||
getParser().Lex(); // Eat EndOfStatement token.
|
||||
return false;
|
||||
}
|
||||
|
||||
extern "C" void LLVMInitializeMipsAsmParser() {
|
||||
RegisterMCAsmParser<MipsAsmParser> X(TheMipsTarget);
|
||||
RegisterMCAsmParser<MipsAsmParser> Y(TheMipselTarget);
|
||||
|
Reference in New Issue
Block a user