From b90c2f3bfc45084b582c9199cfe50aca917c34ff Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Mon, 8 Oct 2018 11:52:38 -0700 Subject: [PATCH] [debug] Print proc attributes on the procedure page Reviewed By: jeremydubreil Differential Revision: D10238661 fbshipit-source-id: 2de9ee425 --- infer/src/IR/PredSymb.ml | 8 ++++---- infer/src/IR/ProcAttributes.ml | 6 +----- infer/src/backend/printer.ml | 11 ++++++----- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/infer/src/IR/PredSymb.ml b/infer/src/IR/PredSymb.ml index 791a9343b..42d35d312 100644 --- a/infer/src/IR/PredSymb.ml +++ b/infer/src/IR/PredSymb.ml @@ -24,13 +24,13 @@ let equal_access = [%compare.equal: access] let string_of_access = function | Default -> - "" + "Default" | Public -> - "" + "Public" | Private -> - "" + "Private" | Protected -> - "" + "Protected" (** Return the value of the FA_sentinel attribute in [attr_list] if it is found *) diff --git a/infer/src/IR/ProcAttributes.ml b/infer/src/IR/ProcAttributes.ml index 5c1d41f81..fef5a323e 100644 --- a/infer/src/IR/ProcAttributes.ml +++ b/infer/src/IR/ProcAttributes.ml @@ -132,7 +132,6 @@ let pp f 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 F.fprintf f "; captured= [@[%a@]]@," pp_parameters captured ; - pp_bool_default ~default:default.did_preanalysis "did_preanalysis" did_preanalysis f () ; 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) @@ -166,10 +165,7 @@ let pp f (Pp.to_string ~f:ClangMethodKind.to_string) clang_method_kind ; if not (Location.equal default.loc loc) then F.fprintf f "; loc= %a@," Location.pp_file_pos loc ; - 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) - locals ; + F.fprintf f "; locals= [@[%a@]]@," (Pp.semicolon_seq ~print_env:Pp.text_break pp_var_data) locals ; pp_bool_default ~default:default.has_added_return_param "has_added_return_param" has_added_return_param f () ; if not (Annot.Method.is_empty method_annotation) then diff --git a/infer/src/backend/printer.ml b/infer/src/backend/printer.ml index 0a90ed025..efbc74d86 100644 --- a/infer/src/backend/printer.ml +++ b/infer/src/backend/printer.ml @@ -217,8 +217,7 @@ let node_finish_session node = source ) -(** Write html file for the procedure. - The boolean indicates whether to print whole seconds only *) +(** Write html file for the procedure. *) let write_proc_html pdesc = if Config.write_html then ( let pname = Procdesc.get_proc_name pdesc in @@ -234,12 +233,14 @@ let write_proc_html pdesc = []) linenum ; Pp.seq (pp_node_link [] ~description:true) fmt nodes ; - match Summary.get pname with + ( match Summary.get pname with | None -> () | Some summary -> - Summary.pp_html source Black fmt summary ; - Io_infer.Html.close (fd, fmt) ) + F.pp_print_string fmt "
@\n" ; + Summary.pp_html source Black fmt summary ) ; + F.fprintf fmt "
@\n
@\n%a
@\n" ProcAttributes.pp (Procdesc.get_attributes pdesc) ; + Io_infer.Html.close (fd, fmt) ) (** Creare a hash table mapping line numbers to the set of errors occurring on that line *)