@@ -48,43 +48,29 @@ struct
4848 | YamlEntryGlobal (g , task ) ->
4949 let g: V. t = Obj. obj g in
5050 let (locked, unlocked, multithread) = ctx.global g in
51- let loc = Node. location g in
52- let location_function = (Node. find_fundec g).svar.vname in
53- let location = YamlWitness.Entry. location ~location: loc ~location_function in
5451 let entries =
55- (* TODO: do ghost_variable -s only once *)
52+ (* TODO: do variable_entry -s only once *)
5653 Locked. fold (fun l acc ->
57- let variable = WitnessGhost. name_varinfo (Locked l) in
58- let type_ = " int" in
59- let initial = " 0" in
60- let entry = YamlWitness.Entry. ghost_variable ~task ~variable ~type_ ~initial in
54+ let entry = WitnessGhost. variable_entry ~task (Locked l) in
6155 Queries.YS. add entry acc
6256 ) (Locked. union locked unlocked) (Queries.YS. empty () )
6357 in
6458 let entries =
6559 Locked. fold (fun l acc ->
66- let variable = WitnessGhost. name_varinfo (Locked l) in
67- let expression = " 1" in
68- let entry = YamlWitness.Entry. ghost_update ~task ~location ~variable ~expression in
60+ let entry = WitnessGhost. update_entry ~task ~node: g (Locked l) GoblintCil. one in
6961 Queries.YS. add entry acc
7062 ) locked entries
7163 in
7264 let entries =
7365 Unlocked. fold (fun l acc ->
74- let variable = WitnessGhost. name_varinfo (Locked l) in
75- let expression = " 0" in
76- let entry = YamlWitness.Entry. ghost_update ~task ~location ~variable ~expression in
66+ let entry = WitnessGhost. update_entry ~task ~node: g (Locked l) GoblintCil. zero in
7767 Queries.YS. add entry acc
7868 ) unlocked entries
7969 in
8070 let entries =
8171 if not (GobConfig. get_bool " exp.earlyglobs" ) && multithread then (
82- let variable = WitnessGhost. name_varinfo Multithreaded in
83- let type_ = " int" in
84- let initial = " 0" in
85- let entry = YamlWitness.Entry. ghost_variable ~task ~variable ~type_ ~initial in
86- let expression = " 1" in
87- let entry' = YamlWitness.Entry. ghost_update ~task ~location ~variable ~expression in
72+ let entry = WitnessGhost. variable_entry ~task Multithreaded in
73+ let entry' = WitnessGhost. update_entry ~task ~node: g Multithreaded GoblintCil. one in
8874 Queries.YS. add entry (Queries.YS. add entry' entries)
8975 )
9076 else
0 commit comments