@ -93,7 +93,7 @@ module Node = struct
; kind : nodekind (* * kind of node *)
; kind : nodekind (* * kind of node *)
; loc : Location . t (* * location in the source code *)
; loc : Location . t (* * location in the source code *)
; mutable preds : t list (* * predecessor nodes in the cfg *)
; mutable preds : t list (* * predecessor nodes in the cfg *)
; pname _opt : Typ . Procname . t option (* * name of the procedure the node belongs to *)
; pname : Typ . Procname . t (* * name of the procedure the node belongs to *)
; mutable succs : t list (* * successor nodes in the cfg *) }
; mutable succs : t list (* * successor nodes in the cfg *) }
let exn_handler_kind = Stmt_node ExceptionHandler
let exn_handler_kind = Stmt_node ExceptionHandler
@ -102,13 +102,13 @@ module Node = struct
let throw_kind = Stmt_node Throw
let throw_kind = Stmt_node Throw
let dummy pname _opt =
let dummy pname =
{ id = 0
{ id = 0
; dist_exit = None
; dist_exit = None
; instrs = Instrs . empty
; instrs = Instrs . empty
; kind = Skip_node " dummy "
; kind = Skip_node " dummy "
; loc = Location . dummy
; loc = Location . dummy
; pname _opt
; pname
; succs = []
; succs = []
; preds = []
; preds = []
; exn = [] }
; exn = [] }
@ -142,14 +142,7 @@ module Node = struct
let get_exn node = node . exn
let get_exn node = node . exn
(* * Get the name of the procedure the node belongs to *)
(* * Get the name of the procedure the node belongs to *)
let get_proc_name node =
let get_proc_name node = node . pname
match node . pname_opt with
| None ->
L . internal_error " get_proc_name: at node %d@ \n " node . id ;
assert false
| Some pname ->
pname
(* * Get the predecessors of the node *)
(* * Get the predecessors of the node *)
let get_preds node = node . preds
let get_preds node = node . preds
@ -408,9 +401,9 @@ type t =
; mutable loop_heads : NodeSet . t option (* * loop head nodes of this procedure *) }
; mutable loop_heads : NodeSet . t option (* * loop head nodes of this procedure *) }
let from_proc_attributes attributes =
let from_proc_attributes attributes =
let pname _opt = Some attributes . ProcAttributes . proc_name in
let pname = attributes . ProcAttributes . proc_name in
let start_node = Node . dummy pname _opt in
let start_node = Node . dummy pname in
let exit_node = Node . dummy pname _opt in
let exit_node = Node . dummy pname in
{ attributes ; nodes = [] ; nodes_num = 0 ; start_node ; exit_node ; loop_heads = None }
{ attributes ; nodes = [] ; nodes_num = 0 ; start_node ; exit_node ; loop_heads = None }
@ -549,7 +542,7 @@ let create_node_internal pdesc loc kind instrs =
; kind
; kind
; loc
; loc
; preds = []
; preds = []
; pname _opt = Some pdesc . attributes . proc_name
; pname = pdesc . attributes . proc_name
; succs = []
; succs = []
; exn = [] }
; exn = [] }
in
in