Browse Source

Make free-root-node CFG instructions value-less

jonathanvdc 8 years ago
parent
commit
2f12145d5e
1 changed files with 9 additions and 0 deletions
  1. 9 0
      kernel/modelverse_jit/cfg_ir.py

+ 9 - 0
kernel/modelverse_jit/cfg_ir.py

@@ -184,6 +184,11 @@ class FlowInstruction(Instruction):
         """Gets a list of basic blocks targeted by this flow instruction."""
         raise NotImplementedError()
 
+    def has_side_effects(self):
+        """Tells if this instruction has side-effects."""
+        # All flow-instructions have side-effects!
+        return True
+
 class JumpFlow(FlowInstruction):
     """Represents a control flow instruction which jumps directly to a basic block."""
     def __init__(self, branch):
@@ -407,6 +412,10 @@ class DeallocateRootNode(Value):
         """Gets all definitions and instructions on which this instruction depends."""
         return [self.root_node]
 
+    def has_value(self):
+        """Tells if this value produces a result that is not None."""
+        return False
+
     def has_side_effects(self):
         """Tells if this instruction has side-effects."""
         return True