mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Implement .cfi_escape. Patch by Brian Anderson!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147352 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -301,6 +301,8 @@ public:
|
||||
&GenericAsmParser::ParseDirectiveCFIRestoreState>(".cfi_restore_state");
|
||||
AddDirectiveHandler<
|
||||
&GenericAsmParser::ParseDirectiveCFISameValue>(".cfi_same_value");
|
||||
AddDirectiveHandler<
|
||||
&GenericAsmParser::ParseDirectiveCFIEscape>(".cfi_escape");
|
||||
|
||||
// Macro directives.
|
||||
AddDirectiveHandler<&GenericAsmParser::ParseDirectiveMacrosOnOff>(
|
||||
@@ -334,6 +336,7 @@ public:
|
||||
bool ParseDirectiveCFIRememberState(StringRef, SMLoc DirectiveLoc);
|
||||
bool ParseDirectiveCFIRestoreState(StringRef, SMLoc DirectiveLoc);
|
||||
bool ParseDirectiveCFISameValue(StringRef, SMLoc DirectiveLoc);
|
||||
bool ParseDirectiveCFIEscape(StringRef, SMLoc DirectiveLoc);
|
||||
|
||||
bool ParseDirectiveMacrosOnOff(StringRef, SMLoc DirectiveLoc);
|
||||
bool ParseDirectiveMacro(StringRef, SMLoc DirectiveLoc);
|
||||
@@ -2812,6 +2815,30 @@ bool GenericAsmParser::ParseDirectiveCFISameValue(StringRef IDVal,
|
||||
return false;
|
||||
}
|
||||
|
||||
/// ParseDirectiveCFIEscape
|
||||
/// ::= .cfi_escape expression[,...]
|
||||
bool GenericAsmParser::ParseDirectiveCFIEscape(StringRef IDVal,
|
||||
SMLoc DirectiveLoc) {
|
||||
std::string Values;
|
||||
int64_t CurrValue;
|
||||
if (getParser().ParseAbsoluteExpression(CurrValue))
|
||||
return true;
|
||||
|
||||
Values.push_back((uint8_t)CurrValue);
|
||||
|
||||
while (getLexer().is(AsmToken::Comma)) {
|
||||
Lex();
|
||||
|
||||
if (getParser().ParseAbsoluteExpression(CurrValue))
|
||||
return true;
|
||||
|
||||
Values.push_back((uint8_t)CurrValue);
|
||||
}
|
||||
|
||||
getStreamer().EmitCFIEscape(Values);
|
||||
return false;
|
||||
}
|
||||
|
||||
/// ParseDirectiveMacrosOnOff
|
||||
/// ::= .macros_on
|
||||
/// ::= .macros_off
|
||||
|
Reference in New Issue
Block a user