ProcAttributes: removed unused proc_flags

Reviewed By: ngorogiannis, jvillard

Differential Revision: D9850918

fbshipit-source-id: 13dbb03f2
master
Mehdi Bouaziz 7 years ago committed by Facebook Github Bot
parent 16c70d1c23
commit f57e7028a8

@ -8,14 +8,8 @@
(** Attributes of a procedure. *)
open! IStd
module Hashtbl = Caml.Hashtbl
module F = Format
(** flags for a procedure *)
type proc_flags = (string, string) Hashtbl.t
let proc_flags_empty () : proc_flags = Hashtbl.create 1
(** Type for ObjC accessors *)
type objc_accessor_type = Objc_getter of Typ.Struct.field | Objc_setter of Typ.Struct.field
[@@deriving compare]
@ -77,7 +71,6 @@ type t =
; mutable locals: var_data list (** name, type and attributes of local variables *)
; method_annotation: Annot.Method.t (** annotations for all methods *)
; objc_accessor: objc_accessor_type option (** type of ObjC accessor, if any *)
; proc_flags: proc_flags (** flags of the procedure *)
; proc_name: Typ.Procname.t (** name of the procedure *)
; ret_type: Typ.t (** return type *)
; has_added_return_param: bool (** whether or not a return param was added *) }
@ -107,7 +100,6 @@ let default translation_unit proc_name =
; has_added_return_param= false
; method_annotation= Annot.Method.empty
; objc_accessor= None
; proc_flags= proc_flags_empty ()
; proc_name
; ret_type= Typ.mk Typ.Tvoid }
@ -141,7 +133,6 @@ let pp f
; has_added_return_param
; method_annotation
; objc_accessor
; proc_flags
; proc_name
; ret_type }[@warning "+9"]) =
let default = default translation_unit proc_name in
@ -202,14 +193,6 @@ let pp f
F.fprintf f "; method_annotation= %a@," (Annot.Method.pp "") method_annotation ;
if not ([%compare.equal: objc_accessor_type option] default.objc_accessor objc_accessor) then
F.fprintf f "; objc_accessor= %a@," (Pp.option pp_objc_accessor_type) objc_accessor ;
if
(* HACK: this hardcodes the default instead of comparing to [default.proc_flags], and tests
emptiness in linear time too *)
not (Int.equal (Hashtbl.length proc_flags) 0)
then
F.fprintf f "; proc_flags= [@[%a@]]@,"
(Pp.hashtbl ~key:F.pp_print_string ~value:F.pp_print_string)
proc_flags ;
(* always print ret type *)
F.fprintf f "; ret_type= %a @," (Typ.pp_full Pp.text) ret_type ;
F.fprintf f "; proc_id= %s }@]" (Typ.Procname.to_unique_id proc_name)

@ -9,9 +9,6 @@ open! IStd
(** Attributes of a procedure. *)
(** flags for a procedure *)
type proc_flags = (string, string) Caml.Hashtbl.t
type objc_accessor_type = Objc_getter of Typ.Struct.field | Objc_setter of Typ.Struct.field
val kind_of_objc_accessor_type : objc_accessor_type -> string
@ -49,7 +46,6 @@ type t =
; mutable locals: var_data list (** name, type and attributes of local variables *)
; method_annotation: Annot.Method.t (** annotations for all methods *)
; objc_accessor: objc_accessor_type option (** type of ObjC accessor, if any *)
; proc_flags: proc_flags (** flags of the procedure *)
; proc_name: Typ.Procname.t (** name of the procedure *)
; ret_type: Typ.t (** return type *)
; has_added_return_param: bool (** whether or not a return param was added *) }

@ -87,7 +87,6 @@ type summary_val =
; vsymop: int
; verr: int
; vfile: string
; vflags: ProcAttributes.proc_flags
; vline: int
; vsignature: string
; vproof_trace: string }
@ -123,7 +122,6 @@ let summary_values summary =
; vto= Summary.Stats.failure_kind_to_string stats
; vsymop= Summary.Stats.symops stats
; verr= Errlog.size (Exceptions.equal_severity Exceptions.Error) err_log
; vflags= attributes.ProcAttributes.proc_flags
; vfile= SourceFile.to_string attributes.ProcAttributes.loc.Location.file
; vline= attributes.ProcAttributes.loc.Location.line
; vsignature

@ -171,6 +171,3 @@ let cli_args fmt args =
let pair ~fst ~snd fmt (a, b) = F.fprintf fmt "(%a,@,%a)" fst a snd b
let hashtbl ~key ~value fmt h =
Caml.Hashtbl.iter (fun k v -> F.fprintf fmt "%a@ ->@ %a" key k value v) h

@ -100,10 +100,3 @@ val pair :
-> F.formatter
-> 'a * 'b
-> unit
val hashtbl :
key:(F.formatter -> 'a -> unit)
-> value:(F.formatter -> 'b -> unit)
-> F.formatter
-> ('a, 'b) Caml.Hashtbl.t
-> unit

Loading…
Cancel
Save