Reporting cleanup 8: move errlog to summary

Reviewed By: jeremydubreil

Differential Revision: D9351379

fbshipit-source-id: 7056c6e87
master
Mehdi Bouaziz 6 years ago committed by Facebook Github Bot
parent ac5633bf58
commit 04af716fba

@ -119,8 +119,6 @@ end
error description, severity, to set of err_data. *)
type t = ErrDataSet.t ErrLogHash.t
let is_empty err_log = Int.equal 0 (ErrLogHash.length err_log)
(** Empty error log *)
let empty () = ErrLogHash.create 13

@ -63,8 +63,6 @@ type t
val empty : unit -> t
(** Empty error log *)
val is_empty : t -> bool
(** type of the function to be passed to iter *)
type iter_fun = err_key -> err_data -> unit

@ -56,7 +56,6 @@ type t =
{ access: PredSymb.access (** visibility access *)
; captured: (Mangled.t * Typ.t) list (** name and type of variables captured in blocks *)
; mutable did_preanalysis: bool (** true if we performed preanalysis on the CFG for this proc *)
; err_log: Errlog.t (** Error log for the procedure *)
; exceptions: string list (** exceptions thrown by the procedure *)
; formals: (Mangled.t * Typ.t) list (** name and type of formal parameters *)
; const_formals: int list (** list of indices of formals that are const-qualified *)
@ -86,7 +85,6 @@ let default translation_unit proc_name =
{ access= PredSymb.Default
; captured= []
; did_preanalysis= false
; err_log= Errlog.empty ()
; exceptions= []
; formals= []
; const_formals= []
@ -121,7 +119,6 @@ let pp f
({ access
; captured
; did_preanalysis
; err_log
; exceptions
; formals
; const_formals
@ -157,8 +154,6 @@ let pp f
if not ([%compare.equal : (Mangled.t * Typ.t) list] default.captured captured) then
F.fprintf f "; captured= [@[%a@]]@," pp_parameters captured ;
pp_bool_default ~default:default.did_preanalysis "did_preanalysis" did_preanalysis f () ;
if not (Errlog.is_empty err_log) then
F.fprintf f "; err_log= [@[%a%a@]]@," Errlog.pp_errors err_log Errlog.pp_warnings err_log ;
if not ([%compare.equal : string list] default.exceptions exceptions) then
F.fprintf f "; exceptions= [@[%a@]]@,"
(Pp.semicolon_seq ~print_env:Pp.text_break F.pp_print_string)

@ -29,7 +29,6 @@ type t =
{ access: PredSymb.access (** visibility access *)
; captured: (Mangled.t * Typ.t) list (** name and type of variables captured in blocks *)
; mutable did_preanalysis: bool (** true if we performed preanalysis on the CFG for this proc *)
; err_log: Errlog.t (** Error log for the procedure *)
; exceptions: string list (** exceptions thrown by the procedure *)
; formals: (Mangled.t * Typ.t) list (** name and type of formal parameters *)
; const_formals: int list (** list of indices of formals that are const-qualified *)

@ -847,7 +847,6 @@ let specialize_types ?(has_clang_model= false) callee_pdesc resolved_pname args
formals= List.rev resolved_params
; proc_name= resolved_pname
; is_specialized= true
; err_log= Errlog.empty ()
; translation_unit }
in
Attributes.store resolved_attributes ;
@ -1004,7 +1003,6 @@ let specialize_with_block_args callee_pdesc pname_with_block_args block_args =
{ callee_attributes with
proc_name= pname_with_block_args
; is_defined= true
; err_log= Errlog.empty ()
; formals= new_formals_blocks_captured_vars
; method_annotation= (fst callee_attributes.method_annotation, extended_formals_annots)
; translation_unit }

@ -73,7 +73,12 @@ module Status = struct
end
type t =
{payloads: Payloads.t; sessions: int ref; stats: Stats.t; status: Status.t; proc_desc: Procdesc.t}
{ payloads: Payloads.t
; sessions: int ref
; stats: Stats.t
; status: Status.t
; proc_desc: Procdesc.t
; err_log: Errlog.t }
let get_status summary = summary.status
@ -87,7 +92,7 @@ let get_ret_type summary = (get_attributes summary).ProcAttributes.ret_type
let get_formals summary = (get_attributes summary).ProcAttributes.formals
let get_err_log summary = (get_attributes summary).ProcAttributes.err_log
let get_err_log summary = summary.err_log
let get_loc summary = (get_attributes summary).ProcAttributes.loc
@ -239,7 +244,8 @@ let init_summary proc_desc =
; payloads= Payloads.empty
; stats= Stats.empty
; status= Status.Pending
; proc_desc }
; proc_desc
; err_log= Errlog.empty () }
in
Typ.Procname.Hash.replace cache (Procdesc.get_proc_name proc_desc) summary ;
summary

@ -49,7 +49,8 @@ type t =
; sessions: int ref (** Session number: how many nodes went through symbolic execution *)
; stats: Stats.t
; status: Status.t
; proc_desc: Procdesc.t }
; proc_desc: Procdesc.t
; err_log: Errlog.t }
val dummy : t
(** dummy summary for testing *)

Loading…
Cancel
Save