GH-128682: Spill the stack pointer in labels, as well as instructions (GH-129618)

This commit is contained in:
Mark Shannon 2025-02-04 12:18:31 +00:00 committed by GitHub
parent d3c54f3788
commit 2effea4dab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 277 additions and 102 deletions

View file

@ -153,6 +153,7 @@ class Pseudo(Node):
@dataclass
class LabelDef(Node):
name: str
spilled: bool
block: Block
@ -176,12 +177,15 @@ class Parser(PLexer):
@contextual
def label_def(self) -> LabelDef | None:
spilled = False
if self.expect(lx.SPILLED):
spilled = True
if self.expect(lx.LABEL):
if self.expect(lx.LPAREN):
if tkn := self.expect(lx.IDENTIFIER):
if self.expect(lx.RPAREN):
if block := self.block():
return LabelDef(tkn.text, block)
return LabelDef(tkn.text, spilled, block)
return None
@contextual