diff --git a/compiler/ir.py b/compiler/ir.py index 84a5c5d..ddc8217 100644 --- a/compiler/ir.py +++ b/compiler/ir.py @@ -112,7 +112,16 @@ class IRVoid(IRValue): 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):