From a52e80bcadfb7587c8a85f997bd70ddbc8f23874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Thu, 21 Jul 2011 11:54:52 +0200 Subject: [PATCH] Fixed some TODOs --- compiler/heptagon/analysis/typing.ml | 3 ++- compiler/obc/c/cgen.ml | 7 ++++--- compiler/obc/control.ml | 4 +--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/heptagon/analysis/typing.ml b/compiler/heptagon/analysis/typing.ml index 053ac44..1d03255 100644 --- a/compiler/heptagon/analysis/typing.ml +++ b/compiler/heptagon/analysis/typing.ml @@ -442,7 +442,8 @@ and check_type cenv = function | Tarray(ty, e) -> let typed_e = expect_static_exp cenv (Tid Initial.pint) e in Tarray(check_type cenv ty, typed_e) - | Tid ty_name -> Tid ty_name (* TODO bug ? should check that ty_name exists ? *) + (* No need to check that the type is defined as it is done by the scoping. *) + | Tid ty_name -> Tid ty_name | Tprod l -> Tprod (List.map (check_type cenv) l) | Tinvalid -> Tinvalid diff --git a/compiler/obc/c/cgen.ml b/compiler/obc/c/cgen.ml index d23d002..150fe3e 100644 --- a/compiler/obc/c/cgen.ml +++ b/compiler/obc/c/cgen.ml @@ -260,7 +260,7 @@ let rec cexpr_of_static_exp se = Error.message se.se_loc Error.Estatic_exp_compute_failed else cexpr_of_static_exp se' - | Stuple _ -> assert false (** TODO *) + | Stuple _ -> Misc.internal_error "cgen: static tuple" (** [cexpr_of_exp exp] translates the Obj action [exp] to a C expression. *) @@ -707,11 +707,12 @@ let out_decl_of_class_def cd = tasked to reset the class [cd]. *) let reset_fun_def_of_class_def cd = let body = - try + if cd.cd_stateful then let var_env = List.map cvar_of_vd cd.cd_mems in let reset = find_reset_method cd in cstm_of_act_list IdentSet.empty var_env cd.cd_objs reset.m_body - with Not_found -> [] (* TODO C : nicely deal with stateless objects *) + else + [] in Cfundef { f_name = (cname_of_qn cd.cd_name) ^ "_reset"; diff --git a/compiler/obc/control.ml b/compiler/obc/control.ml index 9a4d4d6..f3cb7db 100644 --- a/compiler/obc/control.ml +++ b/compiler/obc/control.ml @@ -86,9 +86,7 @@ let rec find c = function let is_deadcode = function | Aassgn (lhs, e) -> (match e.e_desc with - | Eextvalue w -> - let w' = ext_value_of_pattern lhs in - w = w' (* TODO: proper compare *) + | Eextvalue w -> Obc_compare.compare_lhs_extvalue lhs w = 0 | _ -> false ) | Acase (_, []) -> true