Don't inline all const

This commit is contained in:
Cédric Pasteur 2011-11-21 10:55:53 +01:00
parent 76fb488f8e
commit 641b76133d

View file

@ -21,24 +21,27 @@ open Obc
open Obc_mapfold
let extvaluedesc funs acc evd = match evd with
| Wconst se ->
Wconst (simplify QualEnv.empty se), acc
| Warray (ev,e) ->
let ev, acc = extvalue_it funs acc ev in
(match ev.w_desc with
| Wconst { se_desc = Sarray_power (sv, [_]) } ->
Wconst sv, acc
| Wconst ({ se_desc = Sarray_power (sv, _::idx) } as arr) ->
Wconst {arr with se_desc = Sarray_power (sv, idx)}, acc
| Wconst { se_desc = Sarray sv_l } ->
(match e.e_desc with
| Eextvalue { w_desc = Wconst i } ->
| Wconst se ->
let se = simplify QualEnv.empty se in
(match se.se_desc with
| Sarray_power (sv, [_]) ->
Wconst sv, acc
| Sarray_power (sv, _::idx) ->
Wconst { se with se_desc = Sarray_power (sv, idx)}, acc
| Sarray sv_l ->
(match e.e_desc with
| Eextvalue { w_desc = Wconst i } ->
(try
let indice = int_of_static_exp QualEnv.empty i in
Wconst (Misc.nth_of_list (indice+1) sv_l), acc
with _ -> raise Errors.Fallback)
| _ -> raise Errors.Fallback
)
let indice = int_of_static_exp QualEnv.empty i in
Wconst (Misc.nth_of_list (indice+1) sv_l), acc
with _ -> raise Errors.Fallback)
| _ -> raise Errors.Fallback
)
| _ -> raise Errors.Fallback
)
| _ -> raise Errors.Fallback
)
| _ -> raise Errors.Fallback