Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tealer/teal/basic_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""

from typing import List, Optional, TYPE_CHECKING
import functools

from tealer.teal.instructions.instructions import Instruction

Expand Down Expand Up @@ -45,6 +46,7 @@ def add_instruction(self, instruction: Instruction) -> None:
instruction: intruction to add to the basic block.
"""

self.__str__.cache_clear()
self._instructions.append(instruction)

@property
Expand Down Expand Up @@ -127,6 +129,7 @@ def teal(self) -> Optional["Teal"]:
def teal(self, teal_instance: "Teal") -> None:
self._teal = teal_instance

@functools.lru_cache(maxsize=None)
def __str__(self) -> str:
ret = ""
for ins in self._instructions:
Expand Down