Commit 9c95beaf authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[logic] make {iter,fold}_code_annot operate on normalized annotations

i.e. they will present at most one AAssigns and AAllocates per set of behaviors.
parent 4df1b92c
......@@ -541,25 +541,12 @@ let model_fields ?emitter t =
(**************************************************************************)
let iter_code_annot f stmt =
try
let tbl = Code_annots.find stmt in
Emitter.Usable_emitter.Hashtbl.iter
(fun e l -> List.iter (f (Emitter.Usable_emitter.get e)) !l)
tbl
with Not_found ->
()
let l = code_annot_emitter stmt in
List.iter (fun (a,e) -> f e a) l
let fold_code_annot f stmt acc =
try
let tbl = Code_annots.find stmt in
Emitter.Usable_emitter.Hashtbl.fold
(fun e l acc ->
let e = Emitter.Usable_emitter.get e in
List.fold_left (fun acc x -> f e x acc) acc !l)
tbl
acc
with Not_found ->
acc
let l = code_annot_emitter stmt in
List.fold_left (fun acc (a,e) -> f e a acc) acc l
let iter_all_code_annot ?(sorted=true) f =
let cmp s1 s2 =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment