Compare commits
No commits in common. "19524ea99c4d3ad90e2884ce0ab0623b1df9aabd" and "52092b1480f10f9ea2c72fe3b4d847088851c893" have entirely different histories.
19524ea99c
...
52092b1480
@ -236,15 +236,11 @@ let cp_init_aux_nodes fmt (node, h) =
|
||||
| None -> () (** All auxiliary nodes have been initialized *)
|
||||
| Some n ->
|
||||
begin
|
||||
Format.fprintf fmt "%a\t\tif(!state->is_reset) {\n\
|
||||
\t\t\tstate->aux_states[%d] = malloc (sizeof (%s));\n\
|
||||
\t\t}\n\
|
||||
\t\t((%s*)(state->aux_states[%d]))->is_init = true;\n\
|
||||
\t\t((%s*)(state->aux_states[%d]))->is_reset = state->is_reset;\n"
|
||||
Format.fprintf fmt "%a\t\tstate->aux_states[%d] = malloc (sizeof (%s));\n\
|
||||
\t\t((%s*)(state->aux_states[%d]))->is_init = true;\n"
|
||||
aux (node, nst, i-1)
|
||||
(i-1) (Format.asprintf "t_state_%s" n.n_name)
|
||||
(Format.asprintf "t_state_%s" n.n_name) (i-1)
|
||||
(Format.asprintf "t_state_%s" n.n_name) (i-1)
|
||||
end
|
||||
in
|
||||
let nst = Hashtbl.find h node.in_name in
|
||||
|
@ -19,7 +19,7 @@ let cp_node_state fmt (st: node_state) =
|
||||
if st.nt_count_app = 0
|
||||
then
|
||||
Format.fprintf fmt "typedef struct {%a%a%a\n\
|
||||
\tbool is_init, is_reset;\n\
|
||||
\tbool is_init;\n\
|
||||
} %s;\n\n"
|
||||
print_if_any ("int", st.nt_nb_int, "ivars")
|
||||
print_if_any ("bool", st.nt_nb_bool, "bvars")
|
||||
@ -27,7 +27,7 @@ let cp_node_state fmt (st: node_state) =
|
||||
st.nt_name
|
||||
else
|
||||
Format.fprintf fmt "typedef struct {%a%a%a\n\
|
||||
\tbool is_init, is_reset;\n\
|
||||
\tbool is_init;\n\
|
||||
\tvoid* aux_states[%d]; /* stores the states of auxiliary nodes */\n\
|
||||
} %s;\n\n"
|
||||
print_if_any ("int", st.nt_nb_int, "ivars")
|
||||
@ -191,16 +191,10 @@ and cp_expression fmt (expr, hloc) =
|
||||
end
|
||||
| CReset (node_name, i, v, b) ->
|
||||
begin
|
||||
Format.fprintf fmt "\tif (%a) {\n\
|
||||
\t\t((t_state_%s*)(state->aux_states[%d]))->is_init = true;\n\
|
||||
\t\t((t_state_%s*)(state->aux_states[%d]))->is_reset = true;\n\
|
||||
\t}\n\
|
||||
%a\n"
|
||||
Format.fprintf fmt "\tif (%a) {\n\t\t((t_state_%s*)(state->aux_states[%d]))->is_init = true;\n\t}\n%a\n"
|
||||
cp_value (v, hloc)
|
||||
node_name
|
||||
(i - 1)
|
||||
node_name
|
||||
(i - 1)
|
||||
cp_block (b, hloc)
|
||||
end
|
||||
| CIf (v, b1, []) ->
|
||||
|
Loading…
x
Reference in New Issue
Block a user