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

View File

@ -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))