return f"<range:{start}..{stop}>"
-@plain_data(frozen=True, unsafe_hash=True)
+@plain_data(frozen=True, unsafe_hash=True, repr=False)
@final
class SSAValSubReg(metaclass=InternedMeta):
__slots__ = "ssa_val", "reg_idx"
self.ssa_val = ssa_val
self.reg_idx = reg_idx
+ def __repr__(self):
+ # type: () -> str
+ return f"{self.ssa_val}[{self.reg_idx}]"
+
@plain_data(frozen=True, eq=False, repr=False)
@final
retval[SSAValSubReg(ssa_val, reg_idx)] = v
return FMap(retval)
- def are_always_equal(self, a, b):
+ def is_always_equal(self, a, b):
# type: (SSAValSubReg, SSAValSubReg) -> bool
"""check if a and b are known to be always equal to each other.
This means they can be allocated to the same location if other
@abstractmethod
def __setitem__(self, ssa_val, value):
- # type: (SSAVal, tuple[int, ...]) -> None
+ # type: (SSAVal, Iterable[int]) -> None
...
raise KeyError("SSAVal has no value set", ssa_val)
def __setitem__(self, ssa_val, value):
- # type: (SSAVal, tuple[int, ...]) -> None
+ # type: (SSAVal, Iterable[int]) -> None
+ value = tuple(map(int, value))
if len(value) != ssa_val.ty.reg_len:
raise ValueError("value has wrong len")
self.ssa_vals[ssa_val] = value
return tuple(retval)
def __setitem__(self, ssa_val, value):
- # type: (SSAVal, tuple[int, ...]) -> None
+ # type: (SSAVal, Iterable[int]) -> None
+ value = tuple(map(int, value))
if len(value) != ssa_val.ty.reg_len:
raise ValueError("value has wrong len")
loc = self.ssa_val_to_loc_map[ssa_val]