Fixed some TODOs
This commit is contained in:
parent
69a5ad8df8
commit
a52e80bcad
|
@ -442,7 +442,8 @@ and check_type cenv = function
|
||||||
| Tarray(ty, e) ->
|
| Tarray(ty, e) ->
|
||||||
let typed_e = expect_static_exp cenv (Tid Initial.pint) e in
|
let typed_e = expect_static_exp cenv (Tid Initial.pint) e in
|
||||||
Tarray(check_type cenv ty, typed_e)
|
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)
|
| Tprod l -> Tprod (List.map (check_type cenv) l)
|
||||||
| Tinvalid -> Tinvalid
|
| Tinvalid -> Tinvalid
|
||||||
|
|
||||||
|
|
|
@ -260,7 +260,7 @@ let rec cexpr_of_static_exp se =
|
||||||
Error.message se.se_loc Error.Estatic_exp_compute_failed
|
Error.message se.se_loc Error.Estatic_exp_compute_failed
|
||||||
else
|
else
|
||||||
cexpr_of_static_exp se'
|
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. *)
|
(** [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]. *)
|
tasked to reset the class [cd]. *)
|
||||||
let reset_fun_def_of_class_def cd =
|
let reset_fun_def_of_class_def cd =
|
||||||
let body =
|
let body =
|
||||||
try
|
if cd.cd_stateful then
|
||||||
let var_env = List.map cvar_of_vd cd.cd_mems in
|
let var_env = List.map cvar_of_vd cd.cd_mems in
|
||||||
let reset = find_reset_method cd in
|
let reset = find_reset_method cd in
|
||||||
cstm_of_act_list IdentSet.empty var_env cd.cd_objs reset.m_body
|
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
|
in
|
||||||
Cfundef {
|
Cfundef {
|
||||||
f_name = (cname_of_qn cd.cd_name) ^ "_reset";
|
f_name = (cname_of_qn cd.cd_name) ^ "_reset";
|
||||||
|
|
|
@ -86,9 +86,7 @@ let rec find c = function
|
||||||
let is_deadcode = function
|
let is_deadcode = function
|
||||||
| Aassgn (lhs, e) ->
|
| Aassgn (lhs, e) ->
|
||||||
(match e.e_desc with
|
(match e.e_desc with
|
||||||
| Eextvalue w ->
|
| Eextvalue w -> Obc_compare.compare_lhs_extvalue lhs w = 0
|
||||||
let w' = ext_value_of_pattern lhs in
|
|
||||||
w = w' (* TODO: proper compare *)
|
|
||||||
| _ -> false
|
| _ -> false
|
||||||
)
|
)
|
||||||
| Acase (_, []) -> true
|
| Acase (_, []) -> true
|
||||||
|
|
Loading…
Reference in a new issue