Skip to content

Commit

Permalink
Remove unnecessary arg for alloc_reg
Browse files Browse the repository at this point in the history
  • Loading branch information
brunokim committed Dec 8, 2021
1 parent 116fb7a commit 64f1312
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,13 +554,13 @@ def temp_addr(self, x: Union[Var, Struct], *, is_head: bool = False) -> Tuple[Re
# Conflict avoidance: do not use registers that are necessary for last goal args.
no_use = no_use | self.conflict[x]

addr = self.alloc_reg(x, use, no_use)
addr = self.alloc_reg(use, no_use)
self.set_reg(addr, x)

alloc = AddrAlloc.NEW_VAR if isinstance(x, Var) else AddrAlloc.NEW_STRUCT
return addr, alloc

def alloc_reg(self, x: Union[Var, Struct], use: Set[Register], no_use: Set[Register]) -> Register:
def alloc_reg(self, use: Set[Register], no_use: Set[Register]) -> Register:
"""Allocate a register for a variable or struct."""
# Try to allocate a free register.
free = self.free_regs & use
Expand Down

0 comments on commit 64f1312

Please sign in to comment.