|
@@ -233,6 +233,14 @@ def create_indirect_call(target, argument_list):
|
|
|
[('function_id', target), ('named_arguments', dict_literal)],
|
|
|
tree_ir.LoadLocalInstruction(jit_runtime.KWARGS_PARAMETER_NAME))
|
|
|
|
|
|
+def create_return(return_value):
|
|
|
+ """Creates a return statement that returns the given return value."""
|
|
|
+ return tree_ir.ReturnInstruction(
|
|
|
+ tree_ir.CompoundInstruction(
|
|
|
+ return_value,
|
|
|
+ tree_ir.DeleteEdgeInstruction(
|
|
|
+ tree_ir.LoadLocalInstruction(jit_runtime.LOCALS_EDGE_NAME))))
|
|
|
+
|
|
|
def with_debug_info_trace(instruction, debug_info, function_name):
|
|
|
"""Prepends the given instruction with a tracing instruction that prints
|
|
|
the given debug information and function name."""
|
|
@@ -340,13 +348,6 @@ class AnalysisState(object):
|
|
|
|
|
|
def analyze_return(self, instruction):
|
|
|
"""Tries to analyze the given 'return' instruction."""
|
|
|
- def create_return(return_value):
|
|
|
- return tree_ir.ReturnInstruction(
|
|
|
- tree_ir.CompoundInstruction(
|
|
|
- return_value,
|
|
|
- tree_ir.DeleteEdgeInstruction(
|
|
|
- tree_ir.LoadLocalInstruction(jit_runtime.LOCALS_EDGE_NAME))))
|
|
|
-
|
|
|
if instruction.value is None:
|
|
|
raise primitive_functions.PrimitiveFinished(
|
|
|
create_return(
|