You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
123 lines
4.1 KiB
123 lines
4.1 KiB
10 years ago
|
(*
|
||
10 years ago
|
* Copyright (c) 2009 - 2013 Monoidics ltd.
|
||
|
* Copyright (c) 2013 - present Facebook, Inc.
|
||
|
* All rights reserved.
|
||
|
*
|
||
|
* This source code is licensed under the BSD style license found in the
|
||
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||
|
*)
|
||
10 years ago
|
|
||
8 years ago
|
open! IStd
|
||
9 years ago
|
|
||
7 years ago
|
(** Procedure summaries: the results of the capture and all the analysis for a single procedure,
|
||
|
plus some statistics *)
|
||
10 years ago
|
|
||
|
(** Execution statistics *)
|
||
|
type stats =
|
||
8 years ago
|
{ stats_failure: SymOp.failure_kind option
|
||
|
(** what type of failure stopped the analysis (if any) *)
|
||
|
; symops: int (** Number of SymOp's throughout the whole analysis of the function *)
|
||
|
; mutable nodes_visited_fp: IntSet.t (** Nodes visited during the footprint phase *)
|
||
7 years ago
|
; mutable nodes_visited_re: IntSet.t (** Nodes visited during the re-execution phase *) }
|
||
10 years ago
|
|
||
7 years ago
|
(** Analysis status of the procedure *)
|
||
|
type status =
|
||
|
| Pending (** the summary has been created by the procedure has not been analyzed yet *)
|
||
|
| Analyzed (** the analysis of the procedure is finished *)
|
||
8 years ago
|
|
||
|
val equal_status : status -> status -> bool
|
||
|
|
||
|
val string_of_status : status -> string
|
||
|
|
||
7 years ago
|
(** analysis results *)
|
||
10 years ago
|
type payload =
|
||
7 years ago
|
{ annot_map: AnnotReachabilityDomain.astate option
|
||
7 years ago
|
; biabduction: BiabductionSummary.t option
|
||
7 years ago
|
; buffer_overrun: BufferOverrunDomain.Summary.t option
|
||
|
; crashcontext_frame: Stacktree_t.stacktree option
|
||
|
; litho: LithoDomain.astate option
|
||
8 years ago
|
; quandary: QuandarySummary.t option
|
||
7 years ago
|
; racerd: RacerDDomain.summary option
|
||
8 years ago
|
; resources: ResourceLeakDomain.summary option
|
||
|
; siof: SiofDomain.astate option
|
||
7 years ago
|
; typestate: unit TypeState.t option
|
||
7 years ago
|
; uninit: UninitDomain.summary option
|
||
7 years ago
|
; cost: CostDomain.summary option
|
||
7 years ago
|
; starvation: StarvationDomain.summary option }
|
||
10 years ago
|
|
||
7 years ago
|
(** summary of a procedure name *)
|
||
|
type t =
|
||
|
{ payload: payload
|
||
8 years ago
|
; sessions: int ref (** Session number: how many nodes went trough symbolic execution *)
|
||
7 years ago
|
; stats: stats
|
||
|
; status: status
|
||
7 years ago
|
; proc_desc: Procdesc.t }
|
||
10 years ago
|
|
||
7 years ago
|
val dummy : t
|
||
8 years ago
|
(** dummy summary for testing *)
|
||
8 years ago
|
|
||
7 years ago
|
val add : Typ.Procname.t -> t -> unit
|
||
8 years ago
|
(** Add the summary to the table for the given function *)
|
||
10 years ago
|
|
||
7 years ago
|
val has_model : Typ.Procname.t -> bool
|
||
8 years ago
|
(** Check if a summary for a given procedure exists in the models directory *)
|
||
10 years ago
|
|
||
7 years ago
|
val clear_cache : unit -> unit
|
||
|
(** remove all the elements from the cache of summaries *)
|
||
10 years ago
|
|
||
7 years ago
|
val get : Typ.Procname.t -> t option
|
||
8 years ago
|
(** Return the summary option for the procedure name *)
|
||
8 years ago
|
|
||
7 years ago
|
val get_proc_name : t -> Typ.Procname.t
|
||
8 years ago
|
(** Get the procedure name *)
|
||
10 years ago
|
|
||
7 years ago
|
val get_proc_desc : t -> Procdesc.t
|
||
7 years ago
|
|
||
7 years ago
|
val get_attributes : t -> ProcAttributes.t
|
||
8 years ago
|
(** Get the attributes of the procedure. *)
|
||
10 years ago
|
|
||
7 years ago
|
val get_formals : t -> (Mangled.t * Typ.t) list
|
||
7 years ago
|
(** Get the formal parameters of the procedure *)
|
||
10 years ago
|
|
||
7 years ago
|
val get_err_log : t -> Errlog.t
|
||
7 years ago
|
|
||
7 years ago
|
val get_loc : t -> Location.t
|
||
7 years ago
|
|
||
7 years ago
|
val get_signature : t -> string
|
||
8 years ago
|
(** Return the signature of a procedure declaration as a string *)
|
||
10 years ago
|
|
||
7 years ago
|
val get_unsafe : Typ.Procname.t -> t
|
||
8 years ago
|
(** @deprecated Return the summary for the procedure name. Raises an exception when not found. *)
|
||
10 years ago
|
|
||
7 years ago
|
val get_status : t -> status
|
||
8 years ago
|
(** Return the status (active v.s. inactive) of a procedure summary *)
|
||
10 years ago
|
|
||
7 years ago
|
val reset : Procdesc.t -> t
|
||
8 years ago
|
(** Reset a summary rebuilding the dependents and preserving the proc attributes if present. *)
|
||
10 years ago
|
|
||
7 years ago
|
val load_from_file : DB.filename -> t option
|
||
10 years ago
|
|
||
7 years ago
|
val pp_html : SourceFile.t -> Pp.color -> Format.formatter -> t -> unit
|
||
8 years ago
|
(** Print the summary in html format *)
|
||
9 years ago
|
|
||
7 years ago
|
val pp_text : Format.formatter -> t -> unit
|
||
8 years ago
|
(** Print the summary in text format *)
|
||
10 years ago
|
|
||
8 years ago
|
val pdesc_resolve_attributes : Procdesc.t -> ProcAttributes.t
|
||
8 years ago
|
(** Like proc_resolve_attributes but start from a proc_desc. *)
|
||
10 years ago
|
|
||
8 years ago
|
val proc_resolve_attributes : Typ.Procname.t -> ProcAttributes.t option
|
||
10 years ago
|
(** Try to find the attributes for a defined proc.
|
||
|
First look at specs (to get attributes computed by analysis)
|
||
|
then look at the attributes table.
|
||
10 years ago
|
If no attributes can be found, return None.
|
||
|
*)
|
||
10 years ago
|
|
||
8 years ago
|
val proc_is_library : ProcAttributes.t -> bool
|
||
10 years ago
|
(** Check if the procedure is from a library:
|
||
10 years ago
|
It's not defined, and there is no spec file for it. *)
|
||
10 years ago
|
|
||
7 years ago
|
val store : t -> unit
|
||
8 years ago
|
(** Save summary for the procedure into the spec database *)
|