Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
harkal committed Sep 24, 2024
1 parent e3c3ba4 commit ba88b4e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions vyper/venom/basicblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,14 +504,6 @@ def remove_instruction(self, instruction: IRInstruction) -> None:
def clear_instructions(self) -> None:
self.instructions = []

@property
def non_phi_instructions(self) -> Iterator[IRInstruction]:
return (inst for inst in self.instructions if inst.opcode != "phi")

@property
def pseudo_instructions(self) -> Iterator[IRInstruction]:
return (inst for inst in self.instructions if inst.is_pseudo)

@property
def phi_instructions(self) -> Iterator[IRInstruction]:
for inst in self.instructions:
Expand All @@ -520,6 +512,10 @@ def phi_instructions(self) -> Iterator[IRInstruction]:
else:
return

@property
def non_phi_instructions(self) -> Iterator[IRInstruction]:
return (inst for inst in self.instructions if inst.opcode != "phi")

@property
def param_instructions(self) -> Iterator[IRInstruction]:
for inst in self.instructions:
Expand All @@ -528,9 +524,13 @@ def param_instructions(self) -> Iterator[IRInstruction]:
else:
return

@property
def pseudo_instructions(self) -> Iterator[IRInstruction]:
return (inst for inst in self.instructions if inst.is_pseudo)

@property
def body_instructions(self) -> Iterator[IRInstruction]:
return (inst for inst in self.instructions[:-1] if inst.opcode not in ["phi", "param"])
return (inst for inst in self.instructions[:-1] if not inst.is_pseudo)

def replace_operands(self, replacements: dict) -> None:
"""
Expand Down

0 comments on commit ba88b4e

Please sign in to comment.