Commit Graph

5 Commits

Author SHA1 Message Date
whitequark d6eb2b023a compiler: monomorphize casts first, but more carefully.
This reverts 425cd7851, which broke the use of casts to define
integer width.

Instead of it, two steps are taken:
  * First, literals are monomorphized, leading to predictable result.
  * Second, casts are monomorphized, in a top-bottom way. I.e.
    consider the expression `int64(round(x))`. If round() was visited
    first, the intermediate precision would be 32-bit, which is
    clearly undesirable. Therefore, contextual rules should take
    priority over non-contextual ones.

Fixes #1252.
2019-02-07 06:24:32 +00:00
whitequark 31048f4b6a compiler: fix monomorphization of coerced integer literals.
Fixes #703.
2017-04-12 04:11:47 +00:00
whitequark e4615e7b37 transforms.int_monomorphizer: visit children of CallT. 2015-12-20 18:07:31 +08:00
whitequark 54aeb5030d transforms.int_monomorphizer: also monomorphize round() calls (#198). 2015-12-20 02:36:30 +08:00
whitequark 196acb37f6 Add IntMonomorphizer. 2015-07-02 19:57:27 +03:00