[inferbo] Print non-verbose program variables

Summary: It prints non-verbose program variables in the report.

Reviewed By: ngorogiannis

Differential Revision: D17163943

fbshipit-source-id: c3f3c2887
master
Sungkeun Cho 5 years ago committed by Facebook Github Bot
parent c872fb5e1d
commit 78cfc867a5

@ -67,29 +67,36 @@ let get_declaring_function pv =
let pp_translation_unit fmt = function None -> () | Some fname -> SourceFile.pp fmt fname
let pp_ f pv =
let pp_ ~verbose f pv =
let name = pv.pv_name in
match pv.pv_kind with
| Local_var _ ->
Mangled.pp f name
| Callee_var _ ->
F.fprintf f "%a|callee" Mangled.pp name
Mangled.pp f name ;
if verbose then F.pp_print_string f "|callee"
| Abduced_retvar _ ->
F.fprintf f "%a|abducedRetvar" Mangled.pp name
Mangled.pp f name ;
if verbose then F.pp_print_string f "|abducedRetvar"
| Abduced_ref_param (_, index, _) ->
F.fprintf f "%a|abducedRefParam%d" Mangled.pp name index
Mangled.pp f name ;
if verbose then F.fprintf f "|abducedRefParam%d" index
| Global_var {translation_unit; is_constexpr; is_ice; is_pod} ->
F.fprintf f "#GB<%a%s%s%s>$%a" pp_translation_unit translation_unit
(if is_constexpr then "|const" else "")
(if is_ice then "|ice" else "")
(if not is_pod then "|!pod" else "")
Mangled.pp name
if verbose then
F.fprintf f "#GB<%a%s%s%s>$" pp_translation_unit translation_unit
(if is_constexpr then "|const" else "")
(if is_ice then "|ice" else "")
(if not is_pod then "|!pod" else "") ;
Mangled.pp f name
| Seed_var ->
F.fprintf f "old_%a" Mangled.pp name
(** Pretty print a pvar which denotes a value, not an address *)
let pp_value f pv = pp_ f pv
let pp_value f pv = pp_ ~verbose:true f pv
(** Non-verbose version of pp_value *)
let pp_value_non_verbose f pv = pp_ ~verbose:false f pv
(** Pretty print a program variable. *)
let pp pe f pv =

@ -118,6 +118,9 @@ val pp : Pp.env -> F.formatter -> t -> unit
val pp_value : F.formatter -> t -> unit
(** Pretty print a pvar which denotes a value, not an address *)
val pp_value_non_verbose : F.formatter -> t -> unit
(** Non-verbose version of pp_value *)
val pp_translation_unit : F.formatter -> translation_unit -> unit
val to_callee : Typ.Procname.t -> t -> t

@ -124,7 +124,7 @@ module SymbolPath = struct
let rec pp_partial_paren ~paren fmt = function
| Pvar pvar ->
Pvar.pp_value fmt pvar
if Config.bo_debug >= 3 then Pvar.pp_value fmt pvar else Pvar.pp_value_non_verbose fmt pvar
| Deref (Deref_JavaPointer, p) when Config.bo_debug < 3 ->
pp_partial_paren ~paren fmt p
| Deref (Deref_ArrayIndex, p) ->

Loading…
Cancel
Save