From 5d64df829eedb3c8287660354d062e6212cad728 Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 14 Oct 2015 16:12:00 +0300 Subject: [PATCH] transforms.artiq_ir_generator: fix devirtualized call annotation. --- artiq/compiler/transforms/artiq_ir_generator.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/artiq/compiler/transforms/artiq_ir_generator.py b/artiq/compiler/transforms/artiq_ir_generator.py index e03a732bc..b39e464d6 100644 --- a/artiq/compiler/transforms/artiq_ir_generator.py +++ b/artiq/compiler/transforms/artiq_ir_generator.py @@ -105,7 +105,9 @@ class ARTIQIRGenerator(algorithm.Visitor): def annotate_calls(self, devirtualization): for var_node in devirtualization.variable_map: callee_node = devirtualization.variable_map[var_node] - callee = self.function_map[callee_node] + if callee_node is None: + continue + callee = self.function_map[callee_node] call_target = self.variable_map[var_node] for use in call_target.uses: @@ -115,7 +117,9 @@ class ARTIQIRGenerator(algorithm.Visitor): for type_and_method in devirtualization.method_map: callee_node = devirtualization.method_map[type_and_method] - callee = self.function_map[callee_node] + if callee_node is None: + continue + callee = self.function_map[callee_node] for call in self.method_map[type_and_method]: assert isinstance(call, (ir.Call, ir.Invoke))