@@ -132,13 +132,7 @@ let () = Printexc.register_printer (function
132132 | _ -> None (* for other exceptions *)
133133 )
134134
135- (* * Type of CFG "edges": keyed by 'from' and 'to' nodes,
136- along with the list of connecting instructions. *)
137- module CfgEdge = struct
138- type t = Node .t * MyCFG .edges * Node .t [@@ deriving eq , hash ]
139- end
140135
141- module CfgEdgeH = BatHashtbl. Make (CfgEdge )
142136
143137let createCFG (file : file ) =
144138 let cfgF = H. create 113 in
@@ -254,7 +248,7 @@ let createCFG (file: file) =
254248 let pseudo_return = lazy (
255249 if Messages. tracing then Messages. trace " cfg" " adding pseudo-return to the function %s.\n " fd.svar.vname;
256250 let fd_end_loc = {fd_loc with line = fd_loc.endLine; byte = fd_loc.endByte; column = fd_loc.endColumn} in
257- let newst = mkStmt (Return (None , fd_end_loc)) in
251+ let newst = mkStmt (Return (None , fd_end_loc, locUnknown )) in
258252 newst.sid < - Cilfacade. get_pseudo_return_id fd;
259253 Cilfacade.StmtH. add Cilfacade. pseudo_return_to_fun newst fd;
260254 Cilfacade.IntH. replace Cilfacade. pseudo_return_stmt_sids newst.sid newst;
@@ -340,8 +334,8 @@ let createCFG (file: file) =
340334 (* CIL's xform_switch_stmt (via prepareCFG) always adds both continue and break statements to all Loops. *)
341335 failwith " MyCFG.createCFG: unprepared Loop"
342336
343- | Return (exp , loc ) ->
344- addEdge (Statement stmt) (loc, Ret (exp, fd)) (Function fd)
337+ | Return (exp , loc , eloc ) ->
338+ addEdge (Statement stmt) (Cilfacade. eloc_fallback ~eloc ~ loc , Ret (exp, fd)) (Function fd)
345339
346340 | Goto (_ , loc ) ->
347341 (* Gotos are generally unnecessary and unwanted because find_real_stmt skips over these. *)
@@ -608,7 +602,7 @@ let fprint_hash_dot cfg =
608602 close_out out
609603
610604
611- let getCFG (file : file ) : cfg * cfg * stmt list CfgEdgeH.t =
605+ let getCFG (file : file ) : cfg * cfg * _ =
612606 let cfgF, cfgB, skippedByEdge = createCFG file in
613607 let cfgF, cfgB, skippedByEdge =
614608 if get_bool " exp.mincfg" then
@@ -617,13 +611,11 @@ let getCFG (file: file) : cfg * cfg * stmt list CfgEdgeH.t =
617611 (cfgF, cfgB, skippedByEdge)
618612 in
619613 if get_bool " justcfg" then fprint_hash_dot cfgB;
620- (fun n -> H. find_default cfgF n [] ), (fun n -> H. find_default cfgB n [] ), skippedByEdge
614+ (fun n -> H. find_default cfgF n [] ), (fun n -> H. find_default cfgB n [] ), ( fun u e v -> CfgEdgeH. find skippedByEdge (u, e, v))
621615
622- let compute_cfg_skips file =
616+ let compute_cfg file =
623617 let cfgF, cfgB, skippedByEdge = getCFG file in
624- (module struct let prev = cfgB let next = cfgF end : CfgBidir ), skippedByEdge
625-
626- let compute_cfg file = fst (compute_cfg_skips file)
618+ (module struct let prev = cfgB let next = cfgF let skippedByEdge = skippedByEdge end : CfgBidirSkip )
627619
628620
629621let iter_fd_edges (module Cfg : CfgBackward ) fd =
0 commit comments