From 7119ca1050eaaaac76e50e8ee2a666e29cc67428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Wed, 7 Sep 2011 11:34:11 +0200 Subject: [PATCH] Made the argument non optional --- compiler/global/signature.ml | 2 +- compiler/heptagon/hept_utils.ml | 2 +- compiler/heptagon/parsing/hept_scoping.ml | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/global/signature.ml b/compiler/global/signature.ml index 322db9c..1b2e72a 100644 --- a/compiler/global/signature.ml +++ b/compiler/global/signature.ml @@ -126,7 +126,7 @@ let types_of_param_list l = List.map (fun p -> p.p_type) l let linearities_of_arg_list l = List.map (fun ad -> ad.a_linearity) l -let mk_arg ?(linearity = Ltop) name ty ck = +let mk_arg name ty linearity ck = { a_type = ty; a_linearity = linearity; a_name = name; a_clock = ck } let mk_param name ty = { p_name = name; p_type = ty } diff --git a/compiler/heptagon/hept_utils.ml b/compiler/heptagon/hept_utils.ml index ca24226..10d11b6 100644 --- a/compiler/heptagon/hept_utils.ml +++ b/compiler/heptagon/hept_utils.ml @@ -105,7 +105,7 @@ let rec vd_mem n = function let args_of_var_decs = (* before the clocking the clock is wrong in the signature *) List.map (fun vd -> Signature.mk_arg (Some (Idents.source_name vd.v_ident)) - vd.v_type Signature.Cbase) + vd.v_type vd.v_linearity Signature.Cbase) let signature_of_node n = { node_inputs = args_of_var_decs n.n_input; diff --git a/compiler/heptagon/parsing/hept_scoping.ml b/compiler/heptagon/parsing/hept_scoping.ml index ce0c144..730c7e7 100644 --- a/compiler/heptagon/parsing/hept_scoping.ml +++ b/compiler/heptagon/parsing/hept_scoping.ml @@ -545,8 +545,9 @@ let translate_signature s = and translate_clock ck = match ck with | Cbase -> Signature.Cbase | Con(ck,c,x) -> Signature.Con(translate_clock ck, qualify_constrs c, x) - and translate_arg a = Signature.mk_arg a.a_name (translate_type s.sig_loc a.a_type) - (translate_some_clock a.a_clock) + and translate_arg a = + Signature.mk_arg a.a_name (translate_type s.sig_loc a.a_type) + a.a_linearity (translate_some_clock a.a_clock) in let n = current_qual s.sig_name in let i = List.map translate_arg s.sig_inputs in