forked from M-Labs/artiq
1
0
Fork 0

transforms.int_monomorphizer: also monomorphize round() calls (#198).

This commit is contained in:
whitequark 2015-12-20 02:36:30 +08:00
parent 95af6daa28
commit 54aeb5030d
1 changed files with 7 additions and 0 deletions

View File

@ -26,3 +26,10 @@ class IntMonomorphizer(algorithm.Visitor):
return return
node.type["width"].unify(types.TValue(width)) 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))