mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Added llvm-mc support for parsing the .include directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75711 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -535,6 +535,8 @@ bool AsmParser::ParseStatement() {
|
||||
return ParseDirectiveDarwinSubsectionsViaSymbols();
|
||||
if (!strcmp(IDVal, ".abort"))
|
||||
return ParseDirectiveAbort();
|
||||
if (!strcmp(IDVal, ".include"))
|
||||
return ParseDirectiveInclude();
|
||||
|
||||
Warning(IDLoc, "ignoring directive for now");
|
||||
EatToEndOfStatement();
|
||||
@@ -1158,3 +1160,25 @@ bool AsmParser::ParseDirectiveDarwinLsym() {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// ParseDirectiveInclude
|
||||
/// ::= .include "filename"
|
||||
bool AsmParser::ParseDirectiveInclude() {
|
||||
const char *Str;
|
||||
|
||||
if (Lexer.isNot(asmtok::String))
|
||||
return TokError("expected string in '.include' directive");
|
||||
|
||||
Str = Lexer.getCurStrVal();
|
||||
|
||||
Lexer.Lex();
|
||||
|
||||
if (Lexer.isNot(asmtok::EndOfStatement))
|
||||
return TokError("unexpected token in '.include' directive");
|
||||
|
||||
Lexer.Lex();
|
||||
|
||||
Out.SwitchInputAssemblyFile(Str);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@@ -119,6 +119,7 @@ private:
|
||||
bool ParseDirectiveDarwinSubsectionsViaSymbols();
|
||||
|
||||
bool ParseDirectiveAbort(); // ".abort"
|
||||
bool ParseDirectiveInclude(); // ".include"
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
Reference in New Issue
Block a user