mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 02:24:29 +00:00
Add support for the .zero directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114077 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -180,6 +180,7 @@ private:
|
||||
bool ParseDirectiveValue(unsigned Size); // ".byte", ".long", ...
|
||||
bool ParseDirectiveFill(); // ".fill"
|
||||
bool ParseDirectiveSpace(); // ".space"
|
||||
bool ParseDirectiveZero(); // ".zero"
|
||||
bool ParseDirectiveSet(); // ".set"
|
||||
bool ParseDirectiveOrg(); // ".org"
|
||||
// ".align{,32}", ".p2align{,w,l}"
|
||||
@ -871,6 +872,8 @@ bool AsmParser::ParseStatement() {
|
||||
return ParseDirectiveFill();
|
||||
if (IDVal == ".space")
|
||||
return ParseDirectiveSpace();
|
||||
if (IDVal == ".zero")
|
||||
return ParseDirectiveZero();
|
||||
|
||||
// Symbol attribute directives
|
||||
|
||||
@ -1353,6 +1356,25 @@ bool AsmParser::ParseDirectiveSpace() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// ParseDirectiveZero
|
||||
/// ::= .zero expression
|
||||
bool AsmParser::ParseDirectiveZero() {
|
||||
CheckForValidSection();
|
||||
|
||||
int64_t NumBytes;
|
||||
if (ParseAbsoluteExpression(NumBytes))
|
||||
return true;
|
||||
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement))
|
||||
return TokError("unexpected token in '.zero' directive");
|
||||
|
||||
Lex();
|
||||
|
||||
getStreamer().EmitFill(NumBytes, 0, DEFAULT_ADDRSPACE);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// ParseDirectiveFill
|
||||
/// ::= .fill expression , expression , expression
|
||||
bool AsmParser::ParseDirectiveFill() {
|
||||
|
Reference in New Issue
Block a user