Do not inline linear extended values.

This commit is contained in:
Adrien Guatto 2011-10-06 16:18:48 +02:00
parent 30089e7d0f
commit 3269a04052

View file

@ -54,9 +54,11 @@ let gather_extvalues_node nd =
| _ -> false
in
let inlinable w = Linearity.is_linear w.w_linearity in
let gather_extvalues_eq _ env eq =
let env = match eq.eq_lhs, eq.eq_rhs.e_desc with
| Evarpat x, Eextvalue w when not (changed_type w) -> Env.add x w env
| Evarpat x, Eextvalue w when not (changed_type w) && inlinable w -> Env.add x w env
| _ -> env
in
eq, env