@@ -31,112 +31,112 @@ struct
3131 let activated = get_string_list " ana.activated" in
3232 emit_single_threaded := List. mem (ModifiedSinceSetjmp.Spec. name () ) activated || List. mem (PoisonVariables.Spec. name () ) activated
3333
34- let do_access (ctx : (D.t, G.t, C.t, V.t) ctx ) (kind :AccessKind.t ) (reach :bool ) (e :exp ) =
34+ let do_access (man : (D.t, G.t, C.t, V.t) man ) (kind :AccessKind.t ) (reach :bool ) (e :exp ) =
3535 if M. tracing then M. trace " access" " do_access %a %a %B" d_exp e AccessKind. pretty kind reach;
3636 let reach_or_mpt: _ Queries. t = if reach then ReachableFrom e else MayPointTo e in
37- let ad = ctx .ask reach_or_mpt in
38- ctx .emit (Access {exp= e; ad; kind; reach})
37+ let ad = man .ask reach_or_mpt in
38+ man .emit (Access {exp= e; ad; kind; reach})
3939
4040 (* * Three access levels:
4141 + [deref=false], [reach=false] - Access [exp] without dereferencing, used for all normal reads and all function call arguments.
4242 + [deref=true], [reach=false] - Access [exp] by dereferencing once (may-point-to), used for lval writes and shallow special accesses.
4343 + [deref=true], [reach=true] - Access [exp] by dereferencing transitively (reachable), used for deep special accesses. *)
44- let access_one_top ?(force =false ) ?(deref =false ) ctx (kind : AccessKind.t ) reach exp =
44+ let access_one_top ?(force =false ) ?(deref =false ) man (kind : AccessKind.t ) reach exp =
4545 if M. tracing then M. traceli " access" " access_one_top %a (kind = %a, reach = %B, deref = %B)" CilType.Exp. pretty exp AccessKind. pretty kind reach deref;
46- if force || ! collect_local || ! emit_single_threaded || ThreadFlag. has_ever_been_multi (Analyses. ask_of_ctx ctx ) then (
46+ if force || ! collect_local || ! emit_single_threaded || ThreadFlag. has_ever_been_multi (Analyses. ask_of_man man ) then (
4747 if deref && Cil. isPointerType (Cilfacade. typeOf exp) then (* avoid dereferencing integers to unknown pointers, which cause many spurious type-based accesses *)
48- do_access ctx kind reach exp;
48+ do_access man kind reach exp;
4949 if M. tracing then M. tracei " access" " distribute_access_exp" ;
50- Access. distribute_access_exp (do_access ctx Read false ) exp;
50+ Access. distribute_access_exp (do_access man Read false ) exp;
5151 if M. tracing then M. traceu " access" " distribute_access_exp" ;
5252 );
5353 if M. tracing then M. traceu " access" " access_one_top"
5454
5555
5656 (* * We just lift start state, global and dependency functions: *)
5757 let startstate v = ()
58- let threadenter ctx ~multiple lval f args = [() ]
58+ let threadenter man ~multiple lval f args = [() ]
5959 let exitstate v = ()
60- let context ctx fd d = ()
60+ let context man fd d = ()
6161
6262
6363 (* * Transfer functions: *)
6464
65- let vdecl ctx v =
66- access_one_top ctx Read false (SizeOf v.vtype);
67- ctx .local
65+ let vdecl man v =
66+ access_one_top man Read false (SizeOf v.vtype);
67+ man .local
6868
69- let assign ctx lval rval : D.t =
69+ let assign man lval rval : D.t =
7070 (* ignore global inits *)
71- if ! AnalysisState. global_initialization then ctx .local else begin
72- access_one_top ~deref: true ctx Write false (AddrOf lval);
73- access_one_top ctx Read false rval;
74- ctx .local
71+ if ! AnalysisState. global_initialization then man .local else begin
72+ access_one_top ~deref: true man Write false (AddrOf lval);
73+ access_one_top man Read false rval;
74+ man .local
7575 end
7676
77- let branch ctx exp tv : D.t =
78- access_one_top ctx Read false exp;
79- ctx .local
77+ let branch man exp tv : D.t =
78+ access_one_top man Read false exp;
79+ man .local
8080
81- let return ctx exp fundec : D.t =
81+ let return man exp fundec : D.t =
8282 begin match exp with
83- | Some exp -> access_one_top ctx Read false exp
83+ | Some exp -> access_one_top man Read false exp
8484 | None -> ()
8585 end ;
86- ctx .local
86+ man .local
8787
88- let body ctx f : D.t =
89- ctx .local
88+ let body man f : D.t =
89+ man .local
9090
91- let special ctx lv f arglist : D.t =
91+ let special man lv f arglist : D.t =
9292 let desc = LF. find f in
9393 match desc.special arglist with
9494 (* TODO: remove Lock/Unlock cases when all those libraryfunctions use librarydescs and don't read mutex contents * )
9595 | Lock _
9696 | Unlock _ ->
97- ctx .local
97+ man .local
9898 | _ ->
9999 LibraryDesc.Accesses. iter desc.accs (fun {kind; deep = reach } exp ->
100- access_one_top ~deref: true ctx kind reach exp (* access dereferenced using special accesses *)
100+ access_one_top ~deref: true man kind reach exp (* access dereferenced using special accesses *)
101101 ) arglist;
102102 (match lv with
103- | Some x -> access_one_top ~deref: true ctx Write false (AddrOf x)
103+ | Some x -> access_one_top ~deref: true man Write false (AddrOf x)
104104 | None -> () );
105- List. iter (access_one_top ctx Read false ) arglist; (* always read all argument expressions without dereferencing *)
106- ctx .local
105+ List. iter (access_one_top man Read false ) arglist; (* always read all argument expressions without dereferencing *)
106+ man .local
107107
108- let enter ctx lv f args : (D.t * D.t) list =
109- [(ctx .local,ctx .local)]
108+ let enter man lv f args : (D.t * D.t) list =
109+ [(man .local,man .local)]
110110
111- let combine_env ctx lval fexp f args fc au f_ask =
111+ let combine_env man lval fexp f args fc au f_ask =
112112 (* These should be in enter, but enter cannot emit events, nor has fexp argument *)
113- access_one_top ctx Read false fexp;
114- List. iter (access_one_top ctx Read false ) args;
113+ access_one_top man Read false fexp;
114+ List. iter (access_one_top man Read false ) args;
115115 au
116116
117- let combine_assign ctx lv fexp f args fc al f_ask =
117+ let combine_assign man lv fexp f args fc al f_ask =
118118 begin match lv with
119119 | None -> ()
120- | Some lval -> access_one_top ~deref: true ctx Write false (AddrOf lval)
120+ | Some lval -> access_one_top ~deref: true man Write false (AddrOf lval)
121121 end ;
122- ctx .local
122+ man .local
123123
124124
125- let threadspawn ctx ~multiple lval f args fctx =
125+ let threadspawn man ~multiple lval f args fman =
126126 (* must explicitly access thread ID lval because special to pthread_create doesn't if singlethreaded before *)
127127 begin match lval with
128128 | None -> ()
129- | Some lval -> access_one_top ~force: true ~deref: true ctx Write false (AddrOf lval) (* must force because otherwise doesn't if singlethreaded before *)
129+ | Some lval -> access_one_top ~force: true ~deref: true man Write false (AddrOf lval) (* must force because otherwise doesn't if singlethreaded before *)
130130 end ;
131- ctx .local
131+ man .local
132132
133- let query ctx (type a ) (q : a Queries.t ): a Queries.result =
133+ let query man (type a ) (q : a Queries.t ): a Queries.result =
134134 match q with
135135 | MayAccessed ->
136- (ctx .global ctx .node: G.t )
136+ (man .global man .node: G.t )
137137 | _ -> Queries.Result. top q
138138
139- let event ctx e octx =
139+ let event man e oman =
140140 match e with
141141 | Events. Access {ad; kind; _} when ! collect_local && ! AnalysisState. postsolving ->
142142 let events = Queries.AD. fold (fun addr es ->
@@ -151,9 +151,9 @@ struct
151151 | _ -> es
152152 ) ad (G. empty () )
153153 in
154- ctx .sideg ctx .node events
154+ man .sideg man .node events
155155 | _ ->
156- ctx .local
156+ man .local
157157end
158158
159159let _ =
0 commit comments