mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-29 13:24:25 +00:00
Added llvm-mc support for parsing the .dump and .load directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75786 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -537,6 +537,10 @@ bool AsmParser::ParseStatement() {
|
||||
return ParseDirectiveAbort();
|
||||
if (!strcmp(IDVal, ".include"))
|
||||
return ParseDirectiveInclude();
|
||||
if (!strcmp(IDVal, ".dump"))
|
||||
return ParseDirectiveDarwinDumpOrLoad(/*IsDump=*/true);
|
||||
if (!strcmp(IDVal, ".load"))
|
||||
return ParseDirectiveDarwinDumpOrLoad(/*IsLoad=*/false);
|
||||
|
||||
Warning(IDLoc, "ignoring directive for now");
|
||||
EatToEndOfStatement();
|
||||
@ -1182,3 +1186,28 @@ bool AsmParser::ParseDirectiveInclude() {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// ParseDirectiveDarwinDumpOrLoad
|
||||
/// ::= ( .dump | .load ) "filename"
|
||||
bool AsmParser::ParseDirectiveDarwinDumpOrLoad(bool IsDump) {
|
||||
const char *Str;
|
||||
|
||||
if (Lexer.isNot(asmtok::String))
|
||||
return TokError("expected string in '.dump' or '.load' directive");
|
||||
|
||||
Str = Lexer.getCurStrVal();
|
||||
|
||||
Lexer.Lex();
|
||||
|
||||
if (Lexer.isNot(asmtok::EndOfStatement))
|
||||
return TokError("unexpected token in '.dump' or '.load' directive");
|
||||
|
||||
Lexer.Lex();
|
||||
|
||||
if (IsDump)
|
||||
Out.DumpSymbolsandMacros(Str);
|
||||
else
|
||||
Out.LoadSymbolsandMacros(Str);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user