File tree Expand file tree Collapse file tree 3 files changed +6
-12
lines changed
Expand file tree Collapse file tree 3 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -2031,12 +2031,11 @@ struct
20312031 v
20322032
20332033 let dump () =
2034- let f = open_out_bin (get_string " exp.priv-prec-dump" ) in (* TODO: Out_channel.with_open_bin *)
2034+ Out_channel. with_open_bin (get_string " exp.priv-prec-dump" ) @@ fun f ->
20352035 (* LVH.iter (fun (l, x) v ->
20362036 Logs.debug "%a %a = %a" CilType.Location.pretty l CilType.Varinfo.pretty x VD.pretty v
20372037 ) lvh; *)
2038- Marshal. output f ({name = get_string " ana.base.privatization" ; results = lvh}: result );
2039- close_out_noerr f
2038+ Stdlib.Marshal. to_channel f ({name = get_string " ana.base.privatization" ; results = lvh}: result ) []
20402039
20412040 let finalize () =
20422041 if ! is_dumping then
Original file line number Diff line number Diff line change 11(* * Serialization/deserialization of incremental analysis data. *)
22
3- open Batteries
4-
53(* TODO: GoblintDir *)
64let incremental_data_file_name = " analysis.data"
75let results_dir = " results"
@@ -22,13 +20,12 @@ let gob_results_dir op =
2220let server () = GobConfig. get_bool " server.enabled"
2321
2422let marshal obj fileName =
25- let chan = open_out_bin (Fpath. to_string fileName) in (* TODO: Out_channel.with_open_bin *)
26- Marshal. output chan obj;
27- close_out chan
23+ Out_channel. with_open_bin (Fpath. to_string fileName) @@ fun chan ->
24+ Marshal. to_channel chan obj []
2825
2926let unmarshal fileName =
3027 Logs. debug " Unmarshalling %s... If type of content changed, this will result in a segmentation fault!" (Fpath. to_string fileName);
31- Marshal. input (open_in_bin ( Fpath. to_string fileName)) (* TODO: In_channel.with_open_bin *)
28+ In_channel. with_open_bin ( Fpath. to_string fileName) Marshal. from_channel
3229
3330let results_exist () =
3431 (* If Goblint did not crash irregularly, the existence of the result directory indicates that there are results *)
Original file line number Diff line number Diff line change @@ -95,10 +95,8 @@ struct
9595 open Util
9696
9797 let load filename =
98- let f = open_in_bin filename in (* TODO: In_channel.with_open_bin *)
99- let dump: dump = Marshal. from_channel f in
98+ let dump: dump = In_channel. with_open_bin filename Stdlib.Marshal. from_channel in
10099 let dump: result = {name = dump.name; results = unmarshal dump.marshalled } in
101- close_in_noerr f;
102100 dump
103101
104102 module CompareDump = MakeHashtbl (Key ) (Dom ) (RH )
You can’t perform that action at this time.
0 commit comments