File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -951,7 +951,7 @@ struct
951951 (* sync: M -> (2^M -> (G -> D)) *)
952952 include AbstractLockCenteredBase (ThreadMap ) (LockCenteredBase. CPA )
953953
954- let global_init_thread = RichVarinfo. single ~name: " global_init"
954+ let global_init_thread = RichVarinfo. single ~name: " global_init" ~typ: GoblintCil. voidType
955955 let current_thread (ask : Q.ask ): Thread.t =
956956 if ! AnalysisState. global_initialization then
957957 ThreadIdDomain.Thread. threadinit (global_init_thread () ) ~multiple: false
Original file line number Diff line number Diff line change @@ -144,6 +144,8 @@ module MallocWrapper : MCPSpec = struct
144144 Format. dprintf " @tid:%s" (ThreadLifted. show t)
145145 in
146146 Format. asprintf " (alloc@sid:%s%t%t)" (Node. show_id node) tid uniq_count
147+
148+ let typ _ = GoblintCil. voidType
147149 end
148150
149151 module NodeVarinfoMap = RichVarinfo.BiVarinfoMap. Make (ThreadNode )
Original file line number Diff line number Diff line change 11open GoblintCil
22
3- let create_var name = Cilfacade. create_var @@ makeGlobalVar name voidType
3+ let create_var name typ = Cilfacade. create_var @@ makeGlobalVar name typ
44
5- let single ~name =
6- let vi = lazy (create_var name) in
5+ let single ~name ~ typ =
6+ let vi = lazy (create_var name typ ) in
77 fun () ->
88 Lazy. force vi
99
@@ -21,6 +21,7 @@ module type G =
2121sig
2222 include Hashtbl. HashedType
2323 val name_varinfo : t -> string
24+ val typ : t -> typ
2425end
2526
2627module type H =
4748 try
4849 XH. find ! xh x
4950 with Not_found ->
50- let vi = create_var (X. name_varinfo x) in
51+ let vi = create_var (X. name_varinfo x) ( X. typ x) in
5152 store_f x vi;
5253 vi
5354
Original file line number Diff line number Diff line change 22
33open GoblintCil
44
5- val single : name :string -> (unit -> varinfo )
5+ val single : name :string -> typ : typ -> (unit -> varinfo )
66
77module type VarinfoMap =
88sig
@@ -18,6 +18,7 @@ module type G =
1818sig
1919 include Hashtbl. HashedType
2020 val name_varinfo : t -> string
21+ val typ : t -> typ
2122end
2223
2324module type H =
Original file line number Diff line number Diff line change 1111 | Locked l -> LockDomain.Addr. show l ^ " _locked" (* TODO: valid C name *)
1212 | Multithreaded -> " multithreaded"
1313
14- (* TODO: define correct types *)
15-
16- let type_ = function
14+ let typ = function
1715 | Locked _ -> GoblintCil. intType
1816 | Multithreaded -> GoblintCil. intType
1917
@@ -30,7 +28,7 @@ include Map
3028
3129let variable_entry ~task x =
3230 let variable = name_varinfo x in
33- let type_ = String. trim (CilType.Typ. show (type_ x)) in (* CIL printer puts space at the end of some types *)
31+ let type_ = String. trim (CilType.Typ. show (typ x)) in (* CIL printer puts space at the end of some types *)
3432 let initial = CilType.Exp. show (initial x) in
3533 YamlWitness.Entry. ghost_variable ~task ~variable ~type_ ~initial
3634
You can’t perform that action at this time.
0 commit comments