From 54aeb5030d46a6e294d2ece4a36b515e0a87266d Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 20 Dec 2015 02:36:30 +0800 Subject: [PATCH] transforms.int_monomorphizer: also monomorphize round() calls (#198). --- artiq/compiler/transforms/int_monomorphizer.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/artiq/compiler/transforms/int_monomorphizer.py b/artiq/compiler/transforms/int_monomorphizer.py index 3aeed9140..397988792 100644 --- a/artiq/compiler/transforms/int_monomorphizer.py +++ b/artiq/compiler/transforms/int_monomorphizer.py @@ -26,3 +26,10 @@ class IntMonomorphizer(algorithm.Visitor): return node.type["width"].unify(types.TValue(width)) + + def visit_CallT(self, node): + if types.is_builtin(node.func.type, "int") or \ + types.is_builtin(node.func.type, "round"): + typ = node.type.find() + if types.is_var(typ["width"]): + typ["width"].unify(types.TValue(32))