ir: IRAssignable: track writers
This commit is contained in:
parent
27ccb1a68a
commit
fb62c3b34a
1 changed files with 10 additions and 1 deletions
|
|
@ -112,7 +112,16 @@ class IRVoid(IRValue):
|
||||||
|
|
||||||
|
|
||||||
class IRAssignable(IRValue, metaclass=abc.ABCMeta):
|
class IRAssignable(IRValue, metaclass=abc.ABCMeta):
|
||||||
pass
|
def __init__(self, location: SourceLocation):
|
||||||
|
super().__init__(location)
|
||||||
|
self.writers: list[IRAction] = []
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.codegen()
|
||||||
|
|
||||||
|
def __repr__(self) -> str:
|
||||||
|
return f"{self.codegen()} (readers: {repr([reader for reader in self.readers])}, " + \
|
||||||
|
f"writers: {repr([writer for writer in self.writers])})"
|
||||||
|
|
||||||
|
|
||||||
class IRRegister(IRAssignable):
|
class IRRegister(IRAssignable):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue