mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
[MC/Mach-O] Add AsmParser support for .linker_option directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172778 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -87,6 +87,8 @@ public:
|
||||
AddDirectiveHandler<
|
||||
&DarwinAsmParser::ParseSectionDirectiveLazySymbolPointers>(
|
||||
".lazy_symbol_pointer");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseDirectiveLinkerOption>(
|
||||
".linker_option");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveLiteral16>(
|
||||
".literal16");
|
||||
AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveLiteral4>(
|
||||
@@ -163,6 +165,7 @@ public:
|
||||
bool ParseDirectiveDesc(StringRef, SMLoc);
|
||||
bool ParseDirectiveDumpOrLoad(StringRef, SMLoc);
|
||||
bool ParseDirectiveLsym(StringRef, SMLoc);
|
||||
bool ParseDirectiveLinkerOption(StringRef, SMLoc);
|
||||
bool ParseDirectiveSection(StringRef, SMLoc);
|
||||
bool ParseDirectivePushSection(StringRef, SMLoc);
|
||||
bool ParseDirectivePopSection(StringRef, SMLoc);
|
||||
@@ -435,6 +438,33 @@ bool DarwinAsmParser::ParseDirectiveDumpOrLoad(StringRef Directive,
|
||||
return Warning(IDLoc, "ignoring directive .load for now");
|
||||
}
|
||||
|
||||
/// ParseDirectiveLinkerOption
|
||||
/// ::= .linker_option "string" ( , "string" )*
|
||||
bool DarwinAsmParser::ParseDirectiveLinkerOption(StringRef IDVal, SMLoc) {
|
||||
SmallVector<std::string, 4> Args;
|
||||
for (;;) {
|
||||
if (getLexer().isNot(AsmToken::String))
|
||||
return TokError("expected string in '" + Twine(IDVal) + "' directive");
|
||||
|
||||
std::string Data;
|
||||
if (getParser().ParseEscapedString(Data))
|
||||
return true;
|
||||
|
||||
Args.push_back(Data);
|
||||
|
||||
Lex();
|
||||
if (getLexer().is(AsmToken::EndOfStatement))
|
||||
break;
|
||||
|
||||
if (getLexer().isNot(AsmToken::Comma))
|
||||
return TokError("unexpected token in '" + Twine(IDVal) + "' directive");
|
||||
Lex();
|
||||
}
|
||||
|
||||
getStreamer().EmitLinkerOptions(Args);
|
||||
return false;
|
||||
}
|
||||
|
||||
/// ParseDirectiveLsym
|
||||
/// ::= .lsym identifier , expression
|
||||
bool DarwinAsmParser::ParseDirectiveLsym(StringRef, SMLoc) {
|
||||
|
Reference in New Issue
Block a user