mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Add support for assigning to . in AsmParser.
This is implemented by handling assignments to the '.' pseudo symbol as ".org" directives. Differential Revision: http://llvm-reviews.chandlerc.com/D2625 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201530 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2119,12 +2119,6 @@ bool AsmParser::parseAssignment(StringRef Name, bool allow_redef,
|
||||
if (Lexer.isNot(AsmToken::EndOfStatement))
|
||||
return TokError("unexpected token in assignment");
|
||||
|
||||
// Error on assignment to '.'.
|
||||
if (Name == ".") {
|
||||
return Error(EqualLoc, ("assignment to pseudo-symbol '.' is unsupported "
|
||||
"(use '.space' or '.org').)"));
|
||||
}
|
||||
|
||||
// Eat the end of statement marker.
|
||||
Lex();
|
||||
|
||||
@@ -2152,11 +2146,15 @@ bool AsmParser::parseAssignment(StringRef Name, bool allow_redef,
|
||||
|
||||
// Don't count these checks as uses.
|
||||
Sym->setUsed(false);
|
||||
} else if (Name == ".") {
|
||||
if (Out.EmitValueToOffset(Value, 0)) {
|
||||
Error(EqualLoc, "expected absolute expression");
|
||||
eatToEndOfStatement();
|
||||
}
|
||||
return false;
|
||||
} else
|
||||
Sym = getContext().GetOrCreateSymbol(Name);
|
||||
|
||||
// FIXME: Handle '.'.
|
||||
|
||||
// Do the assignment.
|
||||
Out.EmitAssignment(Sym, Value);
|
||||
if (NoDeadStrip)
|
||||
|
Reference in New Issue
Block a user