|
|
|
@ -103,14 +103,13 @@ type t =
|
|
|
|
|
; is_synthetic_method: bool (** the procedure is a synthetic method *)
|
|
|
|
|
; clang_method_kind: clang_method_kind (** the kind of method the procedure is *)
|
|
|
|
|
; loc: Location.t (** location of this procedure in the source code *)
|
|
|
|
|
; translation_unit: SourceFile.t option (** translation unit to which the procedure belongs *)
|
|
|
|
|
; translation_unit: SourceFile.t (** translation unit to which the procedure belongs *)
|
|
|
|
|
; 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 *)
|
|
|
|
|
; source_file_captured: SourceFile.t (** source file where the procedure was captured *) }
|
|
|
|
|
; ret_type: Typ.t (** return type *) }
|
|
|
|
|
[@@deriving compare]
|
|
|
|
|
|
|
|
|
|
let default proc_name =
|
|
|
|
@ -133,14 +132,13 @@ let default proc_name =
|
|
|
|
|
; is_synthetic_method= false
|
|
|
|
|
; clang_method_kind= C_FUNCTION
|
|
|
|
|
; loc= Location.dummy
|
|
|
|
|
; translation_unit= None
|
|
|
|
|
; translation_unit= SourceFile.invalid __FILE__
|
|
|
|
|
; locals= []
|
|
|
|
|
; method_annotation= Annot.Method.empty
|
|
|
|
|
; objc_accessor= None
|
|
|
|
|
; proc_flags= proc_flags_empty ()
|
|
|
|
|
; proc_name
|
|
|
|
|
; ret_type= Typ.mk Typ.Tvoid
|
|
|
|
|
; source_file_captured= SourceFile.invalid __FILE__ }
|
|
|
|
|
; ret_type= Typ.mk Typ.Tvoid }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let pp_parameters =
|
|
|
|
@ -173,14 +171,11 @@ let pp f
|
|
|
|
|
; objc_accessor
|
|
|
|
|
; proc_flags
|
|
|
|
|
; proc_name
|
|
|
|
|
; ret_type
|
|
|
|
|
; source_file_captured }[@warning "+9"]) =
|
|
|
|
|
; ret_type }[@warning "+9"]) =
|
|
|
|
|
let default = default proc_name in
|
|
|
|
|
let pp_bool_default ~default title b f () =
|
|
|
|
|
if not (Bool.equal default b) then F.fprintf f "; %s= %b@," title b
|
|
|
|
|
in
|
|
|
|
|
F.fprintf f "@[<v>{ proc_name= %a@,; source_file_captured= %a@," Typ.Procname.pp proc_name
|
|
|
|
|
SourceFile.pp source_file_captured ;
|
|
|
|
|
if not (PredSymb.equal_access default.access access) then
|
|
|
|
|
F.fprintf f "; access= %a@," (Pp.to_string ~f:PredSymb.string_of_access) access ;
|
|
|
|
|
if not ([%compare.equal : (Mangled.t * Typ.t) list] default.captured captured) then
|
|
|
|
@ -224,8 +219,8 @@ let pp f
|
|
|
|
|
(Pp.to_string ~f:string_of_clang_method_kind)
|
|
|
|
|
clang_method_kind ;
|
|
|
|
|
if not (Location.equal default.loc loc) then F.fprintf f "; loc= %a@," Location.pp loc ;
|
|
|
|
|
if not ([%compare.equal : SourceFile.t option] default.translation_unit translation_unit) then
|
|
|
|
|
F.fprintf f "; translation_unit= %a@," (Pp.option SourceFile.pp) translation_unit ;
|
|
|
|
|
if not ([%compare.equal : SourceFile.t] default.translation_unit translation_unit) then
|
|
|
|
|
F.fprintf f "; translation_unit= %a@," SourceFile.pp translation_unit ;
|
|
|
|
|
if not ([%compare.equal : var_data list] default.locals locals) then
|
|
|
|
|
F.fprintf f "; locals= [@[%a@]]@,"
|
|
|
|
|
(Pp.semicolon_seq ~print_env:Pp.text_break pp_var_data)
|
|
|
|
|