Summary: Last checker for good. Updated the README of the lab to reflect changes. Delete now-defunct SummaryPayload: all checkers now behave in a functional manner as far as summary payloads are concerned. Reviewed By: ngorogiannis Differential Revision: D21426550 fbshipit-source-id: 2b52b9f5bmaster
parent
efd8e767cb
commit
0f95d16ac1
@ -1,59 +0,0 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
module type Payload = sig
|
||||
type t
|
||||
|
||||
val field : (Payloads.t, t option) Field.t
|
||||
end
|
||||
|
||||
module type S = sig
|
||||
type t
|
||||
|
||||
val update_summary : t -> Summary.t -> Summary.t
|
||||
|
||||
val of_summary : Summary.t -> t option
|
||||
|
||||
val read_full : caller_summary:Summary.t -> callee_pname:Procname.t -> (Procdesc.t * t) option
|
||||
|
||||
val read : caller_summary:Summary.t -> callee_pname:Procname.t -> t option
|
||||
|
||||
val read_toplevel_procedure : Procname.t -> t option
|
||||
end
|
||||
|
||||
module Make (P : Payload) : S with type t = P.t = struct
|
||||
type t = P.t
|
||||
|
||||
let update_payloads = Field.fset P.field
|
||||
|
||||
let of_payloads = Field.get P.field
|
||||
|
||||
let update_summary p (summary : Summary.t) =
|
||||
{summary with payloads= update_payloads summary.payloads (Some p)}
|
||||
|
||||
|
||||
let of_summary (summary : Summary.t) = of_payloads summary.payloads
|
||||
|
||||
let get_payload analysis_result =
|
||||
let open Option.Monad_infix in
|
||||
analysis_result
|
||||
>>= fun summary -> of_summary summary >>| fun payload -> (Summary.get_proc_desc summary, payload)
|
||||
|
||||
|
||||
let read_full ~caller_summary ~callee_pname =
|
||||
Ondemand.analyze_proc_name ~caller_summary callee_pname |> get_payload
|
||||
|
||||
|
||||
let read ~caller_summary ~callee_pname =
|
||||
Ondemand.analyze_proc_name ~caller_summary callee_pname |> get_payload |> Option.map ~f:snd
|
||||
|
||||
|
||||
let read_toplevel_procedure callee_pname =
|
||||
Ondemand.analyze_proc_name_no_caller callee_pname |> get_payload |> Option.map ~f:snd
|
||||
end
|
@ -1,35 +0,0 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
module type Payload = sig
|
||||
type t
|
||||
|
||||
val field : (Payloads.t, t option) Field.t
|
||||
end
|
||||
|
||||
module type S = sig
|
||||
type t
|
||||
|
||||
val update_summary : t -> Summary.t -> Summary.t
|
||||
(** Update the corresponding part of the payload in the procedure summary *)
|
||||
|
||||
val of_summary : Summary.t -> t option
|
||||
(** Read the corresponding part of the payload from the procedure summary *)
|
||||
|
||||
val read_full : caller_summary:Summary.t -> callee_pname:Procname.t -> (Procdesc.t * t) option
|
||||
(** Return the proc desc and payload for the given procedure. Runs the analysis on-demand if
|
||||
necessary. *)
|
||||
|
||||
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_toplevel_procedure : Procname.t -> t option
|
||||
end
|
||||
|
||||
module Make (P : Payload) : S with type t = P.t
|
@ -0,0 +1,14 @@
|
||||
; Copyright (c) Facebook, Inc. and its affiliates.
|
||||
;
|
||||
; This source code is licensed under the MIT license found in the
|
||||
; LICENSE file in the root directory of this source tree.
|
||||
|
||||
(library
|
||||
(name labs)
|
||||
(public_name infer.labs)
|
||||
(flags
|
||||
(:standard -open Core -open InferIR -open InferStdlib -open IStd -open InferGenerated
|
||||
-open InferBase -open Absint))
|
||||
(libraries core InferStdlib InferGenerated InferBase InferIR absint)
|
||||
(preprocess (pps ppx_compare))
|
||||
)
|
Loading…
Reference in new issue