From 3269a04052af541875b8086eef71526e4f089489 Mon Sep 17 00:00:00 2001 From: Adrien Guatto Date: Thu, 6 Oct 2011 16:18:48 +0200 Subject: [PATCH] Do not inline linear extended values. --- compiler/minils/transformations/inline_extvalues.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/minils/transformations/inline_extvalues.ml b/compiler/minils/transformations/inline_extvalues.ml index 77beda2..f416cbe 100644 --- a/compiler/minils/transformations/inline_extvalues.ml +++ b/compiler/minils/transformations/inline_extvalues.ml @@ -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