Skip to content
Snippets Groups Projects
Commit 2196948d authored by Pierre Loic Garoche's avatar Pierre Loic Garoche
Browse files

[EMF] Less verbose

parent db7468fd
No related branches found
No related tags found
No related merge requests found
......@@ -290,20 +290,20 @@ let rec pp_emf_instr m fmt i =
| MBranch (g, hl) -> (
let all_outputs, outputs, inputs = branch_instr_vars m i in
Format.eprintf "Mbranch %a@.vars: all_out: %a, out:%a, in:%a@.@."
Machine_code.pp_instr i
(fprintf_list ~sep:", " pp_var_string) (ISet.elements all_outputs)
(fprintf_list ~sep:", " pp_var_string) (ISet.elements outputs)
pp_emf_vars_decl
(VSet.elements inputs)
;
(* Format.eprintf "Mbranch %a@.vars: all_out: %a, out:%a, in:%a@.@." *)
(* Machine_code.pp_instr i *)
(* (fprintf_list ~sep:", " pp_var_string) (ISet.elements all_outputs) *)
(* (fprintf_list ~sep:", " pp_var_string) (ISet.elements outputs) *)
(* pp_emf_vars_decl *)
(* (VSet.elements inputs) *)
(* ; *)
let inputs = VSet.filter (fun v -> not (ISet.mem v.var_id all_outputs)) inputs in
Format.eprintf "Filtering in: %a@.@."
pp_emf_vars_decl
(VSet.elements inputs)
(* Format.eprintf "Filtering in: %a@.@." *)
(* pp_emf_vars_decl *)
(* (VSet.elements inputs) *)
;
(* ; *)
fprintf fmt "\"kind\": \"branch\",@ ";
fprintf fmt "\"guard\": %a,@ " pp_emf_cst_or_var g; (* it has to be a variable or a constant *)
fprintf fmt "\"outputs\": [%a],@ " (fprintf_list ~sep:", " pp_var_string) (ISet.elements outputs);
......@@ -318,7 +318,7 @@ let rec pp_emf_instr m fmt i =
(fun fmt (tag, instrs_tag) ->
let branch_all_lhs, _, branch_inputs = branch_block_vars m instrs_tag in
let branch_inputs = VSet.filter (fun v -> not (ISet.mem v.var_id branch_all_lhs)) branch_inputs in
fprintf fmt "@[<v 2>\"%s\": {@ " tag;
fprintf fmt "@[<v 2>\"%a\": {@ " print_protect (fun fmt -> Format.pp_print_string fmt tag);
fprintf fmt "\"guard_value\": \"%a\",@ " pp_tag_id tag;
fprintf fmt "\"inputs\": [%a],@ " pp_emf_vars_decl (VSet.elements branch_inputs);
fprintf fmt "@[<v 2>\"instrs\": {@ ";
......
......@@ -43,10 +43,10 @@ let print_protect fmt f =
let s = flush_str_formatter () in
let l = String.length s in
if l > 30 then
let _ = Format.eprintf "Looking for variable %s in hash @[<v 0>%t@]@."
s
(fun fmt -> Hashtbl.iter (fun s new_s -> fprintf fmt "%s -> %s@ " s new_s) hash_map)
in
(* let _ = Format.eprintf "Looking for variable %s in hash @[<v 0>%t@]@." *)
(* s *)
(* (fun fmt -> Hashtbl.iter (fun s new_s -> fprintf fmt "%s -> %s@ " s new_s) hash_map) *)
(* in *)
if Hashtbl.mem hash_map s then
fprintf fmt "%s" (Hashtbl.find hash_map s)
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment