method vinst i =
begin match i with
| Call(_, e, _, _) ->
calls <- calls + 1;
self#add_stat (current_file_name,current_function_name,(0,0,0,1,0,0,0,0));
(match e.enode with
| Lval(Var v, NoOffset) ->
let next tbl =
Varinfo.Hashtbl.replace tbl v (succ (Varinfo.Hashtbl.find tbl v))
in
begin
try next functions_with_source;
with Not_found ->
try next functions_no_source;
with Not_found ->
(* if this iterator is called on a specific global
function only, it might not find the target of this call
so we check if this function is w/ or w/o source and
add 1 to the number of calls accordingly.
*)
(* self#print_all; *)
if not standalone then
let (ya,codeless) = self#find_global_function v in
if ya then
begin
if codeless then
Varinfo.Hashtbl.replace functions_with_source v 0
else
Varinfo.Hashtbl.replace functions_no_source v 0
end
else
Metrics_parameters.fatal "Got no source for %s" v.vname
else
Metrics_parameters.fatal "Got no source for %s" v.vname
end
| _ -> ());
DoChildren
| Set _ ->
assigns <- succ assigns;
self#add_stat (current_file_name,current_function_name,(0,1,0,0,0,0,0,0));
DoChildren
| _ -> DoChildren
end