[inferbo] Use Ondemand.get_proc_desc

Summary: We do not need to run analysis for getting formals.

Reviewed By: ezgicicek

Differential Revision: D19331316

fbshipit-source-id: 59b7ac7f2
master
Sungkeun Cho 5 years ago committed by Facebook Github Bot
parent 89f6390e76
commit 6cc7926e23

@ -24,8 +24,6 @@ module type S = sig
val read : caller_summary:Summary.t -> callee_pname:Procname.t -> t option
val read_proc_desc : caller_summary:Summary.t -> callee_pname:Procname.t -> Procdesc.t option
val read_toplevel_procedure : Procname.t -> t option
end
@ -56,10 +54,6 @@ module Make (P : Payload) : S with type t = P.t = struct
Ondemand.analyze_proc_name ~caller_summary callee_pname |> get_payload |> Option.map ~f:snd
let read_proc_desc ~caller_summary ~callee_pname =
Ondemand.analyze_proc_name ~caller_summary callee_pname |> get_payload |> Option.map ~f:fst
let read_toplevel_procedure callee_pname =
Ondemand.analyze_proc_name_no_caller callee_pname |> get_payload |> Option.map ~f:snd
end

@ -29,9 +29,6 @@ module type S = sig
val read : caller_summary:Summary.t -> callee_pname:Procname.t -> t option
(** Return the payload for the given procedure. Runs the analysis on-demand if necessary. *)
val read_proc_desc : caller_summary:Summary.t -> callee_pname:Procname.t -> Procdesc.t option
(** Return the proc desc for the given procedure. Runs the analysis on-demand if necessary. *)
val read_toplevel_procedure : Procname.t -> t option
end

@ -468,8 +468,7 @@ let cached_compute_invariant_map =
| None ->
let get_summary callee_pname = Payload.read ~caller_summary:summary ~callee_pname in
let get_formals callee_pname =
Payload.read_proc_desc ~caller_summary:summary ~callee_pname
|> Option.map ~f:Procdesc.get_pvar_formals
Ondemand.get_proc_desc callee_pname |> Option.map ~f:Procdesc.get_pvar_formals
in
let inv_map =
compute_invariant_map summary tenv integer_type_widths get_summary get_formals

Loading…
Cancel
Save