Divide Utils into Utils, Pp, and IStd

Summary:
Utils contains definitions intended to be in the global namespace for
all of the infer code-base, as well as pretty-printing functions, and
assorted utility functions mostly for dealing with files and processes.
This diff changes the module opened into the global namespace to
IStd (Std conflict with extlib), and moves the pretty-printing
definitions from Utils to Pp.

Reviewed By: jvillard

Differential Revision: D4232457

fbshipit-source-id: 1e070e0
master
Josh Berdine 8 years ago committed by Facebook Github Bot
parent 23cda11fda
commit e438314776

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Annotations */ /** The Smallfoot Intermediate Language: Annotations */
@ -47,11 +47,11 @@ let module Item = {
/** Pretty print an item annotation. */ /** Pretty print an item annotation. */
let pp fmt ann => { let pp fmt ann => {
let pp fmt (a, _) => pp fmt a; let pp fmt (a, _) => pp fmt a;
F.fprintf fmt "<%a>" (pp_seq pp) ann F.fprintf fmt "<%a>" (Pp.seq pp) ann
}; };
let to_string ann => { let to_string ann => {
let pp fmt () => pp fmt ann; let pp fmt => pp fmt ann;
pp_to_string pp () F.asprintf "%t" pp
}; };
/** Empty item annotation. */ /** Empty item annotation. */
@ -75,7 +75,7 @@ let module Method = {
type t = (Item.t, list Item.t) [@@deriving compare]; type t = (Item.t, list Item.t) [@@deriving compare];
/** Pretty print a method annotation. */ /** Pretty print a method annotation. */
let pp s fmt (ia, ial) => F.fprintf fmt "%a %s(%a)" Item.pp ia s (pp_seq Item.pp) ial; let pp s fmt (ia, ial) => F.fprintf fmt "%a %s(%a)" Item.pp ia s (Pp.seq Item.pp) ial;
/** Empty method annotation. */ /** Empty method annotation. */
let empty = ([], []); let empty = ([], []);

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Annotations */ /** The Smallfoot Intermediate Language: Annotations */

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
let module F = Format; let module F = Format;

@ -8,7 +8,7 @@
*/ */
/** Module to manage the table of attributes. */ /** Module to manage the table of attributes. */
open! Utils; open! IStd;
/** Save .attr file for the procedure into the attributes database. */ /** Save .attr file for the procedure into the attributes database. */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Binary Operators */ /** The Smallfoot Intermediate Language: Binary Operators */
@ -122,8 +122,8 @@ let text =
/** Pretty print a binary operator. */ /** Pretty print a binary operator. */
let str pe binop => let str pe binop =>
switch pe.pe_kind { switch pe.Pp.kind {
| PP_HTML => | HTML =>
switch binop { switch binop {
| Ge => " &gt;= " | Ge => " &gt;= "
| Le => " &lt;= " | Le => " &lt;= "
@ -133,7 +133,7 @@ let str pe binop =>
| Shiftrt => " &gt;&gt; " | Shiftrt => " &gt;&gt; "
| _ => text binop | _ => text binop
} }
| PP_LATEX => | LATEX =>
switch binop { switch binop {
| Ge => " \\geq " | Ge => " \\geq "
| Le => " \\leq " | Le => " \\leq "

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Binary Operators */ /** The Smallfoot Intermediate Language: Binary Operators */
@ -69,4 +69,4 @@ let is_zero_runit: t => bool;
/** String representation of a binary operator. */ /** String representation of a binary operator. */
let str: printenv => t => string; let str: Pp.env => t => string;

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Procnames for the builtin functions supported *) (** Procnames for the builtin functions supported *)
include BUILTINS.S with type t = Procname.t include BUILTINS.S with type t = Procname.t

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Call Flags */ /** The Smallfoot Intermediate Language: Call Flags */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Call Flags */ /** The Smallfoot Intermediate Language: Call Flags */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
let module L = Logging; let module L = Logging;
@ -157,8 +157,8 @@ let inline_synthetic_method ret_id etl pdesc loc_call :option Sil.instr => {
let found instr instr' => { let found instr instr' => {
modified := Some instr'; modified := Some instr';
if debug { if debug {
L.stderr "XX inline_synthetic_method found instr: %a@." (Sil.pp_instr pe_text) instr; L.stderr "XX inline_synthetic_method found instr: %a@." (Sil.pp_instr Pp.text) instr;
L.stderr "XX inline_synthetic_method instr': %a@." (Sil.pp_instr pe_text) instr' L.stderr "XX inline_synthetic_method instr': %a@." (Sil.pp_instr Pp.text) instr'
} }
}; };
let do_instr _ instr => let do_instr _ instr =>

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Control Flow Graph for Interprocedural Analysis */ /** Control Flow Graph for Interprocedural Analysis */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Module for call graphs */ /** Module for call graphs */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Module for call graphs */ /** Module for call graphs */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Constants */ /** The Smallfoot Intermediate Language: Constants */
@ -45,8 +45,8 @@ let pp pe f =>
fun fun
| Cint i => IntLit.pp f i | Cint i => IntLit.pp f i
| Cfun fn => | Cfun fn =>
switch pe.pe_kind { switch pe.Pp.kind {
| PP_HTML => F.fprintf f "_fun_%s" (Escape.escape_xml (Procname.to_string fn)) | HTML => F.fprintf f "_fun_%s" (Escape.escape_xml (Procname.to_string fn))
| _ => F.fprintf f "_fun_%s" (Procname.to_string fn) | _ => F.fprintf f "_fun_%s" (Procname.to_string fn)
} }
| Cstr s => F.fprintf f "\"%s\"" (String.escaped s) | Cstr s => F.fprintf f "\"%s\"" (String.escaped s)
@ -54,7 +54,7 @@ let pp pe f =>
| Cclass c => F.fprintf f "%a" Ident.pp_name c | Cclass c => F.fprintf f "%a" Ident.pp_name c
| Cptr_to_fld fn _ => F.fprintf f "__fld_%a" Ident.pp_fieldname fn; | Cptr_to_fld fn _ => F.fprintf f "__fld_%a" Ident.pp_fieldname fn;
let to_string c => pp_to_string (pp pe_text) c; let to_string c => F.asprintf "%a" (pp Pp.text) c;
let iszero_int_float = let iszero_int_float =
fun fun

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Constants */ /** The Smallfoot Intermediate Language: Constants */
@ -37,7 +37,7 @@ let kind_equal: t => t => bool;
/** Pretty print a const */ /** Pretty print a const */
let pp: printenv => F.formatter => t => unit; let pp: Pp.env => F.formatter => t => unit;
let to_string: t => string; let to_string: t => string;

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Internal representation of data structure for Java, Objective-C and C++ classes, /** Internal representation of data structure for Java, Objective-C and C++ classes,

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Internal representation of data structure for Java, Objective-C and C++ classes, /** Internal representation of data structure for Java, Objective-C and C++ classes,

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Decompiled Expressions */ /** The Smallfoot Intermediate Language: Decompiled Expressions */
@ -49,7 +49,7 @@ let eradicate_java () => Config.eradicate && java ();
let rec to_string = let rec to_string =
fun fun
| Darray de1 de2 => to_string de1 ^ "[" ^ to_string de2 ^ "]" | Darray de1 de2 => to_string de1 ^ "[" ^ to_string de2 ^ "]"
| Dbinop op de1 de2 => "(" ^ to_string de1 ^ Binop.str pe_text op ^ to_string de2 ^ ")" | Dbinop op de1 de2 => "(" ^ to_string de1 ^ Binop.str Pp.text op ^ to_string de2 ^ ")"
| Dconst (Cfun pn) => Procname.to_simplified_string pn | Dconst (Cfun pn) => Procname.to_simplified_string pn
| Dconst c => Const.to_string c | Dconst c => Const.to_string c
| Dderef de => "*" ^ to_string de | Dderef de => "*" ^ to_string de
@ -61,7 +61,7 @@ let rec to_string =
F.fprintf fmt "..." F.fprintf fmt "..."
} }
} else { } else {
pp_comma_seq pp_arg fmt des Pp.comma_seq pp_arg fmt des
}; };
let pp_fun fmt => ( let pp_fun fmt => (
fun fun
@ -81,7 +81,7 @@ let rec to_string =
| [a, ...args'] when isvirtual => (Some a, args') | [a, ...args'] when isvirtual => (Some a, args')
| _ => (None, args) | _ => (None, args)
}; };
let pp fmt () => { let pp fmt => {
let pp_receiver fmt => ( let pp_receiver fmt => (
fun fun
| None => () | None => ()
@ -89,7 +89,7 @@ let rec to_string =
); );
F.fprintf fmt "%a%a(%a)" pp_receiver receiver pp_fun fun_dexp pp_args args' F.fprintf fmt "%a%a(%a)" pp_receiver receiver pp_fun fun_dexp pp_args args'
}; };
pp_to_string pp () F.asprintf "%t" pp
} }
| Darrow (Dpvar pv) f when Pvar.is_this pv => | Darrow (Dpvar pv) f when Pvar.is_this pv =>
/* this->fieldname */ /* this->fieldname */
@ -130,7 +130,7 @@ let rec to_string =
ampersand ^ s ampersand ^ s
} }
| Dunop op de => Unop.str op ^ to_string de | Dunop op de => Unop.str op ^ to_string de
| Dsizeof typ _ _ => pp_to_string (Typ.pp_full pe_text) typ | Dsizeof typ _ _ => F.asprintf "%a" (Typ.pp_full Pp.text) typ
| Dunknown => "unknown" | Dunknown => "unknown"
| Dretcall de _ _ _ => "returned by " ^ to_string de; | Dretcall de _ _ _ => "returned by " ^ to_string de;
@ -145,12 +145,12 @@ let pp_vpath pe fmt vpath => {
fun fun
| Some de => pp fmt de | Some de => pp fmt de
| None => (); | None => ();
if (pe.pe_kind === PP_HTML) { if (pe.Pp.kind === Pp.HTML) {
F.fprintf F.fprintf
fmt fmt
" %a{vpath: %a}%a" " %a{vpath: %a}%a"
Io_infer.Html.pp_start_color Io_infer.Html.pp_start_color
Orange Pp.Orange
pp pp
vpath vpath
Io_infer.Html.pp_end_color Io_infer.Html.pp_end_color

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Decompiled Expressions */ /** The Smallfoot Intermediate Language: Decompiled Expressions */
@ -50,7 +50,7 @@ let pp: F.formatter => t => unit;
/** Pretty print a value path */ /** Pretty print a value path */
let pp_vpath: printenv => F.formatter => vpath => unit; let pp_vpath: Pp.env => F.formatter => vpath => unit;
/** return true if [dexp] contains a temporary pvar */ /** return true if [dexp] contains a temporary pvar */

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
module L = Logging module L = Logging
module F = Format module F = Format
@ -211,11 +211,11 @@ let log_issue _ekind err_log loc node_id_key session ltr exn =
L.err "@\n%a@\n@?" (Exceptions.pp_err node_id_key loc ekind ex_name desc ml_loc_opt) (); L.err "@\n%a@\n@?" (Exceptions.pp_err node_id_key loc ekind ex_name desc ml_loc_opt) ();
if _ekind <> Exceptions.Kerror then begin if _ekind <> Exceptions.Kerror then begin
let warn_str = let warn_str =
let pp fmt () = let pp fmt =
Format.fprintf fmt "%s %a" Format.fprintf fmt "%s %a"
(Localise.to_string err_name) (Localise.to_string err_name)
Localise.pp_error_desc desc in Localise.pp_error_desc desc in
pp_to_string pp () in F.asprintf "%t" pp in
let d = match ekind with let d = match ekind with
| Exceptions.Kerror -> L.d_error | Exceptions.Kerror -> L.d_error
| Exceptions.Kwarning -> L.d_warning | Exceptions.Kwarning -> L.d_warning

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Module for error logs. *) (** Module for error logs. *)

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
module L = Logging module L = Logging
module F = Format module F = Format
@ -320,7 +320,7 @@ let print_exception_html s exn =
let ml_loc_string = match ml_loc_opt with let ml_loc_string = match ml_loc_opt with
| None -> "" | None -> ""
| Some ml_loc -> " " ^ L.ml_loc_to_string ml_loc in | Some ml_loc -> " " ^ L.ml_loc_to_string ml_loc in
let desc_str = pp_to_string Localise.pp_error_desc desc in let desc_str = F.asprintf "%a" Localise.pp_error_desc desc in
(L.d_strln_color Red) (s ^ (Localise.to_string err_name) ^ " " ^ desc_str ^ ml_loc_string) (L.d_strln_color Red) (s ^ (Localise.to_string err_name) ^ " " ^ desc_str ^ ml_loc_string)
(** string describing an error kind *) (** string describing an error kind *)

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Functions for logging and printing exceptions *) (** Functions for logging and printing exceptions *)

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Expressions */ /** The Smallfoot Intermediate Language: Expressions */
@ -230,7 +230,7 @@ let rec pp_ pe pp_t f e => {
| Exn e => F.fprintf f "EXN %a" pp_exp e | Exn e => F.fprintf f "EXN %a" pp_exp e
| Closure {name, captured_vars} => | Closure {name, captured_vars} =>
let id_exps = IList.map (fun (id_exp, _, _) => id_exp) captured_vars; let id_exps = IList.map (fun (id_exp, _, _) => id_exp) captured_vars;
F.fprintf f "(%a)" (pp_comma_seq pp_exp) [Const (Cfun name), ...id_exps] F.fprintf f "(%a)" (Pp.comma_seq pp_exp) [Const (Cfun name), ...id_exps]
| Lvar pv => Pvar.pp pe f pv | Lvar pv => Pvar.pp pe f pv
| Lfield e fld _ => F.fprintf f "%a.%a" pp_exp e Ident.pp_fieldname fld | Lfield e fld _ => F.fprintf f "%a.%a" pp_exp e Ident.pp_fieldname fld
| Lindex e1 e2 => F.fprintf f "%a[%a]" pp_exp e1 pp_exp e2 | Lindex e1 e2 => F.fprintf f "%a[%a]" pp_exp e1 pp_exp e2
@ -242,6 +242,6 @@ let rec pp_ pe pp_t f e => {
let pp_printenv pe pp_typ f e => pp_ pe (pp_typ pe) f e; let pp_printenv pe pp_typ f e => pp_ pe (pp_typ pe) f e;
let pp f e => pp_printenv pe_text Typ.pp f e; let pp f e => pp_printenv Pp.text Typ.pp f e;
let to_string e => F.asprintf "%a" pp e; let to_string e => F.asprintf "%a" pp e;

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Expressions */ /** The Smallfoot Intermediate Language: Expressions */
@ -152,8 +152,7 @@ let lt: t => t => t;
/** Extract the ids and pvars from an expression */ /** Extract the ids and pvars from an expression */
let get_vars: t => (list Ident.t, list Pvar.t); let get_vars: t => (list Ident.t, list Pvar.t);
let pp_printenv: let pp_printenv: Pp.env => (Pp.env => F.formatter => Typ.t => unit) => F.formatter => t => unit;
printenv => (printenv => F.formatter => Typ.t => unit) => F.formatter => t => unit;
let pp: F.formatter => t => unit; let pp: F.formatter => t => unit;

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Module for Names and Identifiers */ /** Module for Names and Identifiers */
@ -364,10 +364,10 @@ let pp_fieldname_latex style f fn => Latex.pp_string style f (Mangled.to_string
/** Pretty print an identifier. */ /** Pretty print an identifier. */
let pp pe f id => let pp pe f id =>
switch pe.pe_kind { switch pe.Pp.kind {
| PP_TEXT | TEXT
| PP_HTML => F.fprintf f "%s" (to_string id) | HTML => F.fprintf f "%s" (to_string id)
| PP_LATEX => | LATEX =>
let base_name = name_to_string id.name; let base_name = name_to_string id.name;
let style = let style =
if (id.kind == KFootprint) { if (id.kind == KFootprint) {
@ -382,8 +382,8 @@ let pp pe f id =>
/** pretty printer for lists of identifiers */ /** pretty printer for lists of identifiers */
let pp_list pe => pp_comma_seq (pp pe); let pp_list pe => Pp.comma_seq (pp pe);
/** pretty printer for lists of names */ /** pretty printer for lists of names */
let pp_name_list = pp_comma_seq pp_name; let pp_name_list = Pp.comma_seq pp_name;

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Identifiers: program variables and logical variables */ /** Identifiers: program variables and logical variables */
@ -245,7 +245,7 @@ let pp_fieldname_latex: Latex.style => Format.formatter => fieldname => unit;
/** Pretty print an identifier. */ /** Pretty print an identifier. */
let pp: printenv => Format.formatter => t => unit; let pp: Pp.env => Format.formatter => t => unit;
/** Convert an identifier to a string. */ /** Convert an identifier to a string. */
@ -253,7 +253,7 @@ let to_string: t => string;
/** Pretty print a list of identifiers. */ /** Pretty print a list of identifiers. */
let pp_list: printenv => Format.formatter => list t => unit; let pp_list: Pp.env => Format.formatter => list t => unit;
/** Pretty print a list of names. */ /** Pretty print a list of names. */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
let module F = Format; let module F = Format;
@ -121,4 +121,4 @@ let pp f (unsigned, n, ptr) =>
F.fprintf f "%Ld" n F.fprintf f "%Ld" n
}; };
let to_string i => pp_to_string pp i; let to_string i => F.asprintf "%a" pp i;

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
let module F = Format; let module F = Format;

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Module to handle IO. Includes html and xml modules. *) (** Module to handle IO. Includes html and xml modules. *)
@ -164,7 +164,7 @@ struct
(** Print start color *) (** Print start color *)
let pp_start_color fmt color = let pp_start_color fmt color =
F.fprintf fmt "%s" ("<span class='" ^ (color_string color) ^ "'>") F.fprintf fmt "%s" ("<span class='" ^ (Pp.color_string color) ^ "'>")
(** Print end color *) (** Print end color *)
let pp_end_color fmt () = let pp_end_color fmt () =
@ -199,7 +199,7 @@ struct
then "dangling" then "dangling"
else if isproof then "visitedproof" else "visited" in else if isproof then "visitedproof" else "visited" in
let node_text = let node_text =
let pp fmt () = let pp fmt =
Format.fprintf fmt Format.fprintf fmt
"<span class='%s'>%s\ "<span class='%s'>%s\
<span class='expansion'>\ <span class='expansion'>\
@ -207,12 +207,12 @@ struct
</span>\ </span>\
</span>" </span>"
style_class display_name id style_class display_name id
(pp_seq Format.pp_print_int) preds (Pp.seq Format.pp_print_int) preds
(pp_seq Format.pp_print_int) succs (Pp.seq Format.pp_print_int) succs
(pp_seq Format.pp_print_int) exn (Pp.seq Format.pp_print_int) exn
description description
(if not isvisited then "\nNOT VISITED" else "") in (if not isvisited then "\nNOT VISITED" else "") in
pp_to_string pp () in F.asprintf "%t" pp in
if not isvisited if not isvisited
then F.fprintf fmt " %s" node_text then F.fprintf fmt " %s" node_text
else pp_link ~path: (path_to_root @ ["nodes"; node_fname]) fmt node_text else pp_link ~path: (path_to_root @ ["nodes"; node_fname]) fmt node_text
@ -308,7 +308,7 @@ struct
pp fmt "%s=\"%s\"" name value pp fmt "%s=\"%s\"" name value
let pp_attributes fmt l = let pp_attributes fmt l =
pp_seq pp_attribute fmt l Pp.seq pp_attribute fmt l
(** print an xml node *) (** print an xml node *)
let rec pp_node newline indent fmt = function let rec pp_node newline indent fmt = function

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Module to handle IO. Includes html and xml modules. *) (** Module to handle IO. Includes html and xml modules. *)
@ -58,7 +58,7 @@ module Html : sig
?with_name: bool -> SourceFile.t -> string list -> Format.formatter -> int * int * int -> unit ?with_name: bool -> SourceFile.t -> string list -> Format.formatter -> int * int * int -> unit
(** Print start color *) (** Print start color *)
val pp_start_color : Format.formatter -> color -> unit val pp_start_color : Format.formatter -> Pp.color -> unit
end end
(** Create and print xml trees *) (** Create and print xml trees *)

@ -9,7 +9,7 @@
(** Module to store a set of issues per procedure *) (** Module to store a set of issues per procedure *)
open! Utils open! IStd
let errLogMap = ref Procname.Map.empty let errLogMap = ref Procname.Map.empty

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Support for localisation *) (** Support for localisation *)
@ -113,7 +113,7 @@ let custom_desc_with_advice description advice tags =
(** pretty print an error description *) (** pretty print an error description *)
let pp_error_desc fmt err_desc = let pp_error_desc fmt err_desc =
let pp_item fmt s = F.fprintf fmt "%s" s in let pp_item fmt s = F.fprintf fmt "%s" s in
pp_seq pp_item fmt err_desc.descriptions Pp.seq pp_item fmt err_desc.descriptions
(** pretty print an error advice *) (** pretty print an error advice *)
let pp_error_advice fmt err_desc = let pp_error_advice fmt err_desc =
@ -379,8 +379,8 @@ let deref_str_dangling dangling_kind_opt =
(** dereference strings for a pointer size mismatch *) (** dereference strings for a pointer size mismatch *)
let deref_str_pointer_size_mismatch typ_from_instr typ_of_object = let deref_str_pointer_size_mismatch typ_from_instr typ_of_object =
let str_from_typ typ = let str_from_typ typ =
let pp f () = Typ.pp_full pe_text f typ in let pp f = Typ.pp_full Pp.text f typ in
pp_to_string pp () in F.asprintf "%t" pp in
{ tags = Tags.create (); { tags = Tags.create ();
value_pre = Some (pointer_or_object ()); value_pre = Some (pointer_or_object ());
value_post = Some ("of type " ^ str_from_typ typ_from_instr); value_post = Some ("of type " ^ str_from_typ typ_from_instr);

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Support for localisation *) (** Support for localisation *)

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
let module F = Format; let module F = Format;

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Location in the original source file */ /** Location in the original source file */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Module for Mangled Names */ /** Module for Mangled Names */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Module for Mangled Names */ /** Module for Mangled Names */

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** This module handles buckets of memory leaks in Objective-C/C++ *) (** This module handles buckets of memory leaks in Objective-C/C++ *)

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** This module handles buckets of memory leaks in Objective-C *) (** This module handles buckets of memory leaks in Objective-C *)

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** This module handles C or Objective-C types for which there are special rules for memory management *) (** This module handles C or Objective-C types for which there are special rules for memory management *)

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** This module models special c struct types from the Apple's Core Foundation libraries (** This module models special c struct types from the Apple's Core Foundation libraries
for which there are particular rules for memory management. *) for which there are particular rules for memory management. *)

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Predicate Symbols */ /** The Smallfoot Intermediate Language: Predicate Symbols */
@ -237,7 +237,7 @@ let to_string pe =>
}; };
let str_vpath = let str_vpath =
if Config.trace_error { if Config.trace_error {
pp_to_string (DecompiledExp.pp_vpath pe) ra.ra_vpath F.asprintf "%a" (DecompiledExp.pp_vpath pe) ra.ra_vpath
} else { } else {
"" ""
}; };

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Predicate Symbols */ /** The Smallfoot Intermediate Language: Predicate Symbols */
@ -160,7 +160,7 @@ let is_undef: t => bool;
/** convert the attribute to a string */ /** convert the attribute to a string */
let to_string: printenv => t => string; let to_string: Pp.env => t => string;
/** Dump an attribute. */ /** Dump an attribute. */

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Attributes of a procedure. */ /** Attributes of a procedure. */

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Attributes of a procedure. */ /** Attributes of a procedure. */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
let module L = Logging; let module L = Logging;
@ -205,7 +205,7 @@ let module Node = {
let pe = let pe =
switch instro { switch instro {
| None => pe0 | None => pe0
| Some instr => pe_extend_colormap pe0 (Obj.repr instr) Red | Some instr => Pp.extend_colormap pe0 (Obj.repr instr) Red
}; };
let instrs = get_instrs node; let instrs = get_instrs node;
let pp_loc fmt () => F.fprintf fmt " %a " Location.pp (get_loc node); let pp_loc fmt () => F.fprintf fmt " %a " Location.pp (get_loc node);
@ -267,8 +267,8 @@ let module Node = {
| Start_node _ => "Start" | Start_node _ => "Start"
| Join_node => "Join" | Join_node => "Join"
}; };
let pp fmt () => F.fprintf fmt "%s\n%a@?" str (pp_instrs pe None sub_instrs::true) node; let pp fmt => F.fprintf fmt "%s\n%a@?" str (pp_instrs pe None sub_instrs::true) node;
pp_to_string pp () F.asprintf "%t" pp
}; };
}; };

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** node of the control flow graph */ /** node of the control flow graph */
@ -60,7 +60,7 @@ let module Node: {
let get_callees: t => list Procname.t; let get_callees: t => list Procname.t;
/** Return a description of the node */ /** Return a description of the node */
let get_description: printenv => t => string; let get_description: Pp.env => t => string;
/** Get the distance to the exit node, if it has been computed */ /** Get the distance to the exit node, if it has been computed */
let get_distance_to_exit: t => option int; let get_distance_to_exit: t => option int;
@ -113,7 +113,7 @@ let module Node: {
/** Print extended instructions for the node, /** Print extended instructions for the node,
highlighting the given subinstruction if present */ highlighting the given subinstruction if present */
let pp_instrs: printenv => sub_instrs::bool => option Sil.instr => Format.formatter => t => unit; let pp_instrs: Pp.env => sub_instrs::bool => option Sil.instr => Format.formatter => t => unit;
/** Replace the instructions to be executed. */ /** Replace the instructions to be executed. */
let replace_instrs: t => list Sil.instr => unit; let replace_instrs: t => list Sil.instr => unit;

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Module for Procedure Names */ /** Module for Procedure Names */
@ -541,7 +541,7 @@ let to_simplified_string withclass::withclass=false p =>
/** Convert a proc name to a filename */ /** Convert a proc name to a filename */
let to_filename proc_name => let to_filename proc_name =>
Escape.escape_filename @@ string_append_crc_cutoff @@ to_unique_id proc_name; Escape.escape_filename @@ Utils.string_append_crc_cutoff @@ to_unique_id proc_name;
/** Pretty print a proc name */ /** Pretty print a proc name */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Module for Procedure Names. */ /** Module for Procedure Names. */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language */ /** The Smallfoot Intermediate Language */
@ -131,20 +131,20 @@ let pp_latex f pv => {
/** Pretty print a pvar which denotes a value, not an address */ /** Pretty print a pvar which denotes a value, not an address */
let pp_value pe f pv => let pp_value pe f pv =>
switch pe.pe_kind { switch pe.Pp.kind {
| PP_TEXT => _pp f pv | TEXT => _pp f pv
| PP_HTML => _pp f pv | HTML => _pp f pv
| PP_LATEX => pp_latex f pv | LATEX => pp_latex f pv
}; };
/** Pretty print a program variable. */ /** Pretty print a program variable. */
let pp pe f pv => { let pp pe f pv => {
let ampersand = let ampersand =
switch pe.pe_kind { switch pe.Pp.kind {
| PP_TEXT => "&" | TEXT => "&"
| PP_HTML => "&amp;" | HTML => "&amp;"
| PP_LATEX => "\\&" | LATEX => "\\&"
}; };
F.fprintf f "%s%a" ampersand (pp_value pe) pv F.fprintf f "%s%a" ampersand (pp_value pe) pv
}; };
@ -155,7 +155,7 @@ let d (pvar: t) => L.add_print_action (L.PTpvar, Obj.repr pvar);
/** Pretty print a list of program variables. */ /** Pretty print a list of program variables. */
let pp_list pe f pvl => F.fprintf f "%a" (pp_seq (fun f e => F.fprintf f "%a" (pp pe) e)) pvl; let pp_list pe f pvl => F.fprintf f "%a" (Pp.seq (fun f e => F.fprintf f "%a" (pp pe) e)) pvl;
/** Dump a list of program variables. */ /** Dump a list of program variables. */
@ -369,5 +369,5 @@ let module Set = PrettyPrintable.MakePPCompareSet {
type nonrec t = t; type nonrec t = t;
let compare = compare; let compare = compare;
let compare_pp = compare_alpha; let compare_pp = compare_alpha;
let pp_element = pp pe_text; let pp_element = pp Pp.text;
}; };

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Program variables. */ /** Program variables. */
@ -117,15 +117,15 @@ let mk_tmp: string => Procname.t => t;
/** Pretty print a program variable. */ /** Pretty print a program variable. */
let pp: printenv => F.formatter => t => unit; let pp: Pp.env => F.formatter => t => unit;
/** Pretty print a list of program variables. */ /** Pretty print a list of program variables. */
let pp_list: printenv => F.formatter => list t => unit; let pp_list: Pp.env => F.formatter => list t => unit;
/** Pretty print a pvar which denotes a value, not an address */ /** Pretty print a pvar which denotes a value, not an address */
let pp_value: printenv => F.formatter => t => unit; let pp_value: Pp.env => F.formatter => t => unit;
/** Turn an ordinary program variable into a callee program variable */ /** Turn an ordinary program variable into a callee program variable */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language */ /** The Smallfoot Intermediate Language */
@ -309,21 +309,29 @@ let module HpredSet = Set.Make {
/** Begin change color if using diff printing, return updated printenv and change status */ /** Begin change color if using diff printing, return updated printenv and change status */
let color_pre_wrapper pe f x => let color_pre_wrapper pe f x =>
if (Config.print_using_diff && pe.pe_kind !== PP_TEXT) { if (Config.print_using_diff && pe.Pp.kind !== Pp.TEXT) {
let color = pe.pe_cmap_norm (Obj.repr x); let color = pe.Pp.cmap_norm (Obj.repr x);
if (color !== pe.pe_color) { if (color !== pe.Pp.color) {
( (
if (pe.pe_kind === PP_HTML) { if (pe.Pp.kind === Pp.HTML) {
Io_infer.Html.pp_start_color Io_infer.Html.pp_start_color
} else { } else {
Latex.pp_color Latex.pp_color
} }
) )
f color; f color;
if (color === Red) { if (color === Pp.Red) {
(/** All subexpressiona red */ {...pe, pe_cmap_norm: colormap_red, pe_color: Red}, true) (
Pp.{
/** All subexpressiona red */
...pe,
cmap_norm: colormap_red,
color: Red
},
true
)
} else { } else {
({...pe, pe_color: color}, true) (Pp.{...pe, color}, true)
} }
} else { } else {
(pe, false) (pe, false)
@ -336,10 +344,10 @@ let color_pre_wrapper pe f x =>
/** Close color annotation if changed */ /** Close color annotation if changed */
let color_post_wrapper changed pe f => let color_post_wrapper changed pe f =>
if changed { if changed {
if (pe.pe_kind === PP_HTML) { if (pe.Pp.kind === Pp.HTML) {
Io_infer.Html.pp_end_color f () Io_infer.Html.pp_end_color f ()
} else { } else {
Latex.pp_color f pe.pe_color Latex.pp_color f pe.Pp.color
} }
}; };
@ -347,7 +355,7 @@ let color_post_wrapper changed pe f =>
/** Print a sequence with difference mode if enabled. */ /** Print a sequence with difference mode if enabled. */
let pp_seq_diff pp pe0 f => let pp_seq_diff pp pe0 f =>
if (not Config.print_using_diff) { if (not Config.print_using_diff) {
pp_comma_seq pp f Pp.comma_seq pp f
} else { } else {
let rec doit = let rec doit =
fun fun
@ -372,7 +380,7 @@ let pp_seq_diff pp pe0 f =>
let pp_exp_printenv pe0 f e0 => { let pp_exp_printenv pe0 f e0 => {
let (pe, changed) = color_pre_wrapper pe0 f e0; let (pe, changed) = color_pre_wrapper pe0 f e0;
let e = let e =
switch pe.pe_obj_sub { switch pe.Pp.obj_sub {
| Some sub => Obj.obj (sub (Obj.repr e0)) /* apply object substitution to expression */ | Some sub => Obj.obj (sub (Obj.repr e0)) /* apply object substitution to expression */
| None => e0 | None => e0
}; };
@ -393,7 +401,7 @@ let d_exp (e: Exp.t) => L.add_print_action (L.PTexp, Obj.repr e);
/** Pretty print a list of expressions. */ /** Pretty print a list of expressions. */
let pp_exp_list pe f expl => (pp_seq (pp_exp_printenv pe)) f expl; let pp_exp_list pe f expl => (Pp.seq (pp_exp_printenv pe)) f expl;
/** dump a list of expressions. */ /** dump a list of expressions. */
@ -430,7 +438,7 @@ let pp_offset pe f =>
/** Convert an offset to a string */ /** Convert an offset to a string */
let offset_to_string e => pp_to_string (pp_offset pe_text) e; let offset_to_string e => F.asprintf "%a" (pp_offset Pp.text) e;
/** dump an offset. */ /** dump an offset. */
@ -511,7 +519,7 @@ let pp_instr pe0 f instr => {
"%a(%a)%a %a" "%a(%a)%a %a"
(pp_exp_printenv pe) (pp_exp_printenv pe)
e e
(pp_comma_seq (pp_exp_typ pe)) (Pp.comma_seq (pp_exp_typ pe))
arg_ts arg_ts
CallFlags.pp CallFlags.pp
cf cf
@ -523,7 +531,7 @@ let pp_instr pe0 f instr => {
F.fprintf f "REMOVE_TEMPS(%a); %a" (Ident.pp_list pe) temps Location.pp loc F.fprintf f "REMOVE_TEMPS(%a); %a" (Ident.pp_list pe) temps Location.pp loc
| Declare_locals ptl loc => | Declare_locals ptl loc =>
let pp_typ fmt (pvar, _) => F.fprintf fmt "%a" (Pvar.pp pe) pvar; let pp_typ fmt (pvar, _) => F.fprintf fmt "%a" (Pvar.pp pe) pvar;
F.fprintf f "DECLARE_LOCALS(%a); %a" (pp_comma_seq pp_typ) ptl Location.pp loc F.fprintf f "DECLARE_LOCALS(%a); %a" (Pp.comma_seq pp_typ) ptl Location.pp loc
}; };
color_post_wrapper changed pe0 f color_post_wrapper changed pe0 f
}; };
@ -552,27 +560,27 @@ let pp_atom pe0 f a => {
let (pe, changed) = color_pre_wrapper pe0 f a; let (pe, changed) = color_pre_wrapper pe0 f a;
switch a { switch a {
| Aeq (BinOp op e1 e2) (Const (Cint i)) when IntLit.isone i => | Aeq (BinOp op e1 e2) (Const (Cint i)) when IntLit.isone i =>
switch pe.pe_kind { switch pe.Pp.kind {
| PP_TEXT | TEXT
| PP_HTML => F.fprintf f "%a" (pp_exp_printenv pe) (Exp.BinOp op e1 e2) | HTML => F.fprintf f "%a" (pp_exp_printenv pe) (Exp.BinOp op e1 e2)
| PP_LATEX => F.fprintf f "%a" (pp_exp_printenv pe) (Exp.BinOp op e1 e2) | LATEX => F.fprintf f "%a" (pp_exp_printenv pe) (Exp.BinOp op e1 e2)
} }
| Aeq e1 e2 => | Aeq e1 e2 =>
switch pe.pe_kind { switch pe.Pp.kind {
| PP_TEXT | TEXT
| PP_HTML => F.fprintf f "%a = %a" (pp_exp_printenv pe) e1 (pp_exp_printenv pe) e2 | HTML => F.fprintf f "%a = %a" (pp_exp_printenv pe) e1 (pp_exp_printenv pe) e2
| PP_LATEX => F.fprintf f "%a{=}%a" (pp_exp_printenv pe) e1 (pp_exp_printenv pe) e2 | LATEX => F.fprintf f "%a{=}%a" (pp_exp_printenv pe) e1 (pp_exp_printenv pe) e2
} }
| Aneq e1 e2 => | Aneq e1 e2 =>
switch pe.pe_kind { switch pe.Pp.kind {
| PP_TEXT | TEXT
| PP_HTML => F.fprintf f "%a != %a" (pp_exp_printenv pe) e1 (pp_exp_printenv pe) e2 | HTML => F.fprintf f "%a != %a" (pp_exp_printenv pe) e1 (pp_exp_printenv pe) e2
| PP_LATEX => F.fprintf f "%a{\\neq}%a" (pp_exp_printenv pe) e1 (pp_exp_printenv pe) e2 | LATEX => F.fprintf f "%a{\\neq}%a" (pp_exp_printenv pe) e1 (pp_exp_printenv pe) e2
} }
| Apred a es => | Apred a es =>
F.fprintf f "%s(%a)" (PredSymb.to_string pe a) (pp_comma_seq (pp_exp_printenv pe)) es F.fprintf f "%s(%a)" (PredSymb.to_string pe a) (Pp.comma_seq (pp_exp_printenv pe)) es
| Anpred a es => | Anpred a es =>
F.fprintf f "!%s(%a)" (PredSymb.to_string pe a) (pp_comma_seq (pp_exp_printenv pe)) es F.fprintf f "!%s(%a)" (PredSymb.to_string pe a) (Pp.comma_seq (pp_exp_printenv pe)) es
}; };
color_post_wrapper changed pe0 f color_post_wrapper changed pe0 f
}; };
@ -733,9 +741,9 @@ let module Predicates: {
/********* END OF MODULE Predicates **********/ /********* END OF MODULE Predicates **********/
let pp_texp_simple pe => let pp_texp_simple pe =>
switch pe.pe_opt { switch pe.Pp.opt {
| PP_SIM_DEFAULT => pp_texp pe | SIM_DEFAULT => pp_texp pe
| PP_SIM_WITH_TYP => pp_texp_full pe | SIM_WITH_TYP => pp_texp_full pe
}; };
let inst_abstraction = Iabstraction; let inst_abstraction = Iabstraction;
@ -906,8 +914,8 @@ let update_inst inst_old inst_new => {
/** describe an instrumentation with a string */ /** describe an instrumentation with a string */
let pp_inst pe f inst => { let pp_inst pe f inst => {
let str = inst_to_string inst; let str = inst_to_string inst;
if (pe.pe_kind === PP_HTML) { if (pe.Pp.kind === Pp.HTML) {
F.fprintf f " %a%s%a" Io_infer.Html.pp_start_color Orange str Io_infer.Html.pp_end_color () F.fprintf f " %a%s%a" Io_infer.Html.pp_start_color Pp.Orange str Io_infer.Html.pp_end_color ()
} else { } else {
F.fprintf f "%s%s%s" (Binop.str pe Lt) str (Binop.str pe Gt) F.fprintf f "%s%s%s" (Binop.str pe Lt) str (Binop.str pe Gt)
} }
@ -925,12 +933,12 @@ let rec pp_sexp_env pe0 envo f se => {
switch se { switch se {
| Eexp e inst => F.fprintf f "%a%a" (pp_exp_printenv pe) e (pp_inst_if_trace pe) inst | Eexp e inst => F.fprintf f "%a%a" (pp_exp_printenv pe) e (pp_inst_if_trace pe) inst
| Estruct fel inst => | Estruct fel inst =>
switch pe.pe_kind { switch pe.Pp.kind {
| PP_TEXT | TEXT
| PP_HTML => | HTML =>
let pp_diff f (n, se) => F.fprintf f "%a:%a" Ident.pp_fieldname n (pp_sexp_env pe envo) se; let pp_diff f (n, se) => F.fprintf f "%a:%a" Ident.pp_fieldname n (pp_sexp_env pe envo) se;
F.fprintf f "{%a}%a" (pp_seq_diff pp_diff pe) fel (pp_inst_if_trace pe) inst F.fprintf f "{%a}%a" (pp_seq_diff pp_diff pe) fel (pp_inst_if_trace pe) inst
| PP_LATEX => | LATEX =>
let pp_diff f (n, se) => let pp_diff f (n, se) =>
F.fprintf f "%a:%a" (Ident.pp_fieldname_latex Latex.Boldface) n (pp_sexp_env pe envo) se; F.fprintf f "%a:%a" (Ident.pp_fieldname_latex Latex.Boldface) n (pp_sexp_env pe envo) se;
F.fprintf f "\\{%a\\}%a" (pp_seq_diff pp_diff pe) fel (pp_inst_if_trace pe) inst F.fprintf f "\\{%a\\}%a" (pp_seq_diff pp_diff pe) fel (pp_inst_if_trace pe) inst
@ -959,20 +967,20 @@ let rec pp_hpred_env pe0 envo f hpred => {
let pe' = let pe' =
switch (e, se) { switch (e, se) {
| (Lvar pvar, Eexp (Var _) _) when not (Pvar.is_global pvar) => | (Lvar pvar, Eexp (Var _) _) when not (Pvar.is_global pvar) =>
{...pe, pe_obj_sub: None} /* dont use obj sub on the var defining it */ Pp.{...pe, obj_sub: None} /* dont use obj sub on the var defining it */
| _ => pe | _ => pe
}; };
switch pe'.pe_kind { switch pe'.Pp.kind {
| PP_TEXT | TEXT
| PP_HTML => | HTML =>
F.fprintf F.fprintf
f "%a|->%a:%a" (pp_exp_printenv pe') e (pp_sexp_env pe' envo) se (pp_texp_simple pe') te f "%a|->%a:%a" (pp_exp_printenv pe') e (pp_sexp_env pe' envo) se (pp_texp_simple pe') te
| PP_LATEX => F.fprintf f "%a\\mapsto %a" (pp_exp_printenv pe') e (pp_sexp_env pe' envo) se | LATEX => F.fprintf f "%a\\mapsto %a" (pp_exp_printenv pe') e (pp_sexp_env pe' envo) se
} }
| Hlseg k hpara e1 e2 elist => | Hlseg k hpara e1 e2 elist =>
switch pe.pe_kind { switch pe.Pp.kind {
| PP_TEXT | TEXT
| PP_HTML => | HTML =>
F.fprintf F.fprintf
f f
"lseg%a(%a,%a,[%a],%a)" "lseg%a(%a,%a,[%a],%a)"
@ -982,11 +990,11 @@ let rec pp_hpred_env pe0 envo f hpred => {
e1 e1
(pp_exp_printenv pe) (pp_exp_printenv pe)
e2 e2
(pp_comma_seq (pp_exp_printenv pe)) (Pp.comma_seq (pp_exp_printenv pe))
elist elist
(pp_hpara_env pe envo) (pp_hpara_env pe envo)
hpara hpara
| PP_LATEX => | LATEX =>
F.fprintf F.fprintf
f f
"\\textsf{lseg}_{%a}(%a,%a,[%a],%a)" "\\textsf{lseg}_{%a}(%a,%a,[%a],%a)"
@ -996,15 +1004,15 @@ let rec pp_hpred_env pe0 envo f hpred => {
e1 e1
(pp_exp_printenv pe) (pp_exp_printenv pe)
e2 e2
(pp_comma_seq (pp_exp_printenv pe)) (Pp.comma_seq (pp_exp_printenv pe))
elist elist
(pp_hpara_env pe envo) (pp_hpara_env pe envo)
hpara hpara
} }
| Hdllseg k hpara_dll iF oB oF iB elist => | Hdllseg k hpara_dll iF oB oF iB elist =>
switch pe.pe_kind { switch pe.Pp.kind {
| PP_TEXT | TEXT
| PP_HTML => | HTML =>
F.fprintf F.fprintf
f f
"dllseg%a(%a,%a,%a,%a,[%a],%a)" "dllseg%a(%a,%a,%a,%a,[%a],%a)"
@ -1018,11 +1026,11 @@ let rec pp_hpred_env pe0 envo f hpred => {
oF oF
(pp_exp_printenv pe) (pp_exp_printenv pe)
iB iB
(pp_comma_seq (pp_exp_printenv pe)) (Pp.comma_seq (pp_exp_printenv pe))
elist elist
(pp_hpara_dll_env pe envo) (pp_hpara_dll_env pe envo)
hpara_dll hpara_dll
| PP_LATEX => | LATEX =>
F.fprintf F.fprintf
f f
"\\textsf{dllseg}_{%a}(%a,%a,%a,%a,[%a],%a)" "\\textsf{dllseg}_{%a}(%a,%a,%a,%a,[%a],%a)"
@ -1036,7 +1044,7 @@ let rec pp_hpred_env pe0 envo f hpred => {
oF oF
(pp_exp_printenv pe) (pp_exp_printenv pe)
iB iB
(pp_comma_seq (pp_exp_printenv pe)) (Pp.comma_seq (pp_exp_printenv pe))
elist elist
(pp_hpara_dll_env pe envo) (pp_hpara_dll_env pe envo)
hpara_dll hpara_dll
@ -1055,9 +1063,9 @@ and pp_hpara_env pe envo f hpara =>
r r
(Ident.pp pe) (Ident.pp pe)
n n
(pp_seq (Ident.pp pe)) (Pp.seq (Ident.pp pe))
svars svars
(pp_seq (Ident.pp pe)) (Pp.seq (Ident.pp pe))
evars evars
(pp_star_seq (pp_hpred_env pe envo)) (pp_star_seq (pp_hpred_env pe envo))
b b
@ -1083,9 +1091,9 @@ and pp_hpara_dll_env pe envo f hpara_dll =>
oB oB
(Ident.pp pe) (Ident.pp pe)
oF oF
(pp_seq (Ident.pp pe)) (Pp.seq (Ident.pp pe))
svars svars
(pp_seq (Ident.pp pe)) (Pp.seq (Ident.pp pe))
evars evars
(pp_star_seq (pp_hpred_env pe envo)) (pp_star_seq (pp_hpred_env pe envo))
b b
@ -1115,7 +1123,7 @@ let d_sexp (se: strexp) => L.add_print_action (L.PTsexp, Obj.repr se);
/** Pretty print a list of expressions. */ /** Pretty print a list of expressions. */
let pp_sexp_list pe f sel => let pp_sexp_list pe f sel =>
F.fprintf f "%a" (pp_seq (fun f se => F.fprintf f "%a" (pp_sexp pe) se)) sel; F.fprintf f "%a" (Pp.seq (fun f se => F.fprintf f "%a" (pp_sexp pe) se)) sel;
/** dump a list of expressions. */ /** dump a list of expressions. */
@ -1393,7 +1401,7 @@ let fav_to_list fav => IList.rev !fav;
/** Pretty print a fav. */ /** Pretty print a fav. */
let pp_fav pe f fav => (pp_seq (Ident.pp pe)) f (fav_to_list fav); let pp_fav pe f fav => (Pp.seq (Ident.pp pe)) f (fav_to_list fav);
/** Copy a [fav]. */ /** Copy a [fav]. */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language */ /** The Smallfoot Intermediate Language */
@ -321,19 +321,19 @@ let hpred_get_lhs: hpred => Exp.t;
/** {2 Pretty Printing} */ /** {2 Pretty Printing} */
/** Begin change color if using diff printing, return updated printenv and change status */ /** Begin change color if using diff printing, return updated printenv and change status */
let color_pre_wrapper: printenv => F.formatter => 'a => (printenv, bool); let color_pre_wrapper: Pp.env => F.formatter => 'a => (Pp.env, bool);
/** Close color annotation if changed */ /** Close color annotation if changed */
let color_post_wrapper: bool => printenv => F.formatter => unit; let color_post_wrapper: bool => Pp.env => F.formatter => unit;
/** Pretty print an expression. */ /** Pretty print an expression. */
let pp_exp_printenv: printenv => F.formatter => Exp.t => unit; let pp_exp_printenv: Pp.env => F.formatter => Exp.t => unit;
/** Pretty print an expression with type. */ /** Pretty print an expression with type. */
let pp_exp_typ: printenv => F.formatter => (Exp.t, Typ.t) => unit; let pp_exp_typ: Pp.env => F.formatter => (Exp.t, Typ.t) => unit;
/** dump an expression. */ /** dump an expression. */
@ -341,11 +341,11 @@ let d_exp: Exp.t => unit;
/** Pretty print a type. */ /** Pretty print a type. */
let pp_texp: printenv => F.formatter => Exp.t => unit; let pp_texp: Pp.env => F.formatter => Exp.t => unit;
/** Pretty print a type with all the details. */ /** Pretty print a type with all the details. */
let pp_texp_full: printenv => F.formatter => Exp.t => unit; let pp_texp_full: Pp.env => F.formatter => Exp.t => unit;
/** Dump a type expression with all the details. */ /** Dump a type expression with all the details. */
@ -353,7 +353,7 @@ let d_texp_full: Exp.t => unit;
/** Pretty print a list of expressions. */ /** Pretty print a list of expressions. */
let pp_exp_list: printenv => F.formatter => list Exp.t => unit; let pp_exp_list: Pp.env => F.formatter => list Exp.t => unit;
/** Dump a list of expressions. */ /** Dump a list of expressions. */
@ -361,7 +361,7 @@ let d_exp_list: list Exp.t => unit;
/** Pretty print an offset */ /** Pretty print an offset */
let pp_offset: printenv => F.formatter => offset => unit; let pp_offset: Pp.env => F.formatter => offset => unit;
/** Convert an offset to a string */ /** Convert an offset to a string */
@ -373,7 +373,7 @@ let d_offset: offset => unit;
/** Pretty print a list of offsets */ /** Pretty print a list of offsets */
let pp_offset_list: printenv => F.formatter => list offset => unit; let pp_offset_list: Pp.env => F.formatter => list offset => unit;
/** Dump a list of offsets */ /** Dump a list of offsets */
@ -389,7 +389,7 @@ let instr_get_exps: instr => list Exp.t;
/** Pretty print an instruction. */ /** Pretty print an instruction. */
let pp_instr: printenv => F.formatter => instr => unit; let pp_instr: Pp.env => F.formatter => instr => unit;
/** Dump an instruction. */ /** Dump an instruction. */
@ -397,7 +397,7 @@ let d_instr: instr => unit;
/** Pretty print a list of instructions. */ /** Pretty print a list of instructions. */
let pp_instr_list: printenv => F.formatter => list instr => unit; let pp_instr_list: Pp.env => F.formatter => list instr => unit;
/** Dump a list of instructions. */ /** Dump a list of instructions. */
@ -405,7 +405,7 @@ let d_instr_list: list instr => unit;
/** Pretty print an atom. */ /** Pretty print an atom. */
let pp_atom: printenv => F.formatter => atom => unit; let pp_atom: Pp.env => F.formatter => atom => unit;
/** Dump an atom. */ /** Dump an atom. */
@ -417,7 +417,7 @@ let inst_to_string: inst => string;
/** Pretty print a strexp. */ /** Pretty print a strexp. */
let pp_sexp: printenv => F.formatter => strexp => unit; let pp_sexp: Pp.env => F.formatter => strexp => unit;
/** Dump a strexp. */ /** Dump a strexp. */
@ -425,7 +425,7 @@ let d_sexp: strexp => unit;
/** Pretty print a strexp list. */ /** Pretty print a strexp list. */
let pp_sexp_list: printenv => F.formatter => list strexp => unit; let pp_sexp_list: Pp.env => F.formatter => list strexp => unit;
/** Dump a strexp. */ /** Dump a strexp. */
@ -433,7 +433,7 @@ let d_sexp_list: list strexp => unit;
/** Pretty print a hpred. */ /** Pretty print a hpred. */
let pp_hpred: printenv => F.formatter => hpred => unit; let pp_hpred: Pp.env => F.formatter => hpred => unit;
/** Dump a hpred. */ /** Dump a hpred. */
@ -441,19 +441,19 @@ let d_hpred: hpred => unit;
/** Pretty print a hpara. */ /** Pretty print a hpara. */
let pp_hpara: printenv => F.formatter => hpara => unit; let pp_hpara: Pp.env => F.formatter => hpara => unit;
/** Pretty print a list of hparas. */ /** Pretty print a list of hparas. */
let pp_hpara_list: printenv => F.formatter => list hpara => unit; let pp_hpara_list: Pp.env => F.formatter => list hpara => unit;
/** Pretty print a hpara_dll. */ /** Pretty print a hpara_dll. */
let pp_hpara_dll: printenv => F.formatter => hpara_dll => unit; let pp_hpara_dll: Pp.env => F.formatter => hpara_dll => unit;
/** Pretty print a list of hpara_dlls. */ /** Pretty print a list of hpara_dlls. */
let pp_hpara_dll_list: printenv => F.formatter => list hpara_dll => unit; let pp_hpara_dll_list: Pp.env => F.formatter => list hpara_dll => unit;
/** Module Predicates records the occurrences of predicates as parameters /** Module Predicates records the occurrences of predicates as parameters
@ -486,7 +486,7 @@ let module Predicates: {
/** Pretty print a hpred with optional predicate env */ /** Pretty print a hpred with optional predicate env */
let pp_hpred_env: printenv => option Predicates.env => F.formatter => hpred => unit; let pp_hpred_env: Pp.env => option Predicates.env => F.formatter => hpred => unit;
/** {2 Functions for traversing SIL data types} */ /** {2 Functions for traversing SIL data types} */
@ -562,7 +562,7 @@ let fav_duplicates: ref bool;
/** Pretty print a fav. */ /** Pretty print a fav. */
let pp_fav: printenv => F.formatter => fav => unit; let pp_fav: Pp.env => F.formatter => fav => unit;
/** Create a new [fav]. */ /** Create a new [fav]. */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Struct Types */ /** The Smallfoot Intermediate Language: Struct Types */
@ -43,14 +43,14 @@ let pp pe name f {fields, supers, methods, annots} =>
Typename.pp Typename.pp
name name
( (
pp_seq ( Pp.seq (
fun f (fld, t, _) => F.fprintf f "\n\t\t%a %a" (Typ.pp_full pe) t Ident.pp_fieldname fld fun f (fld, t, _) => F.fprintf f "\n\t\t%a %a" (Typ.pp_full pe) t Ident.pp_fieldname fld
) )
) )
fields fields
(pp_seq (fun f n => F.fprintf f "\n\t\t%a" Typename.pp n)) (Pp.seq (fun f n => F.fprintf f "\n\t\t%a" Typename.pp n))
supers supers
(pp_seq (fun f m => F.fprintf f "\n\t\t%a" Procname.pp m)) (Pp.seq (fun f m => F.fprintf f "\n\t\t%a" Procname.pp m))
methods methods
Annot.Item.pp Annot.Item.pp
annots annots

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Struct Types */ /** The Smallfoot Intermediate Language: Struct Types */
@ -37,7 +37,7 @@ let compare_fld_typ_ann:
/** Pretty print a struct type. */ /** Pretty print a struct type. */
let pp: printenv => Typename.t => F.formatter => t => unit; let pp: Pp.env => Typename.t => F.formatter => t => unit;
/** Construct a struct_typ, normalizing field types */ /** Construct a struct_typ, normalizing field types */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Subtypes */ /** The Smallfoot Intermediate Language: Subtypes */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Subtypes */ /** The Smallfoot Intermediate Language: Subtypes */

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Module for Type Environments. */ /** Module for Type Environments. */
@ -27,7 +27,7 @@ let pp fmt (tenv: t) =>
( (
fun name typ => { fun name typ => {
Format.fprintf fmt "@[<6>NAME: %s@." (Typename.to_string name); Format.fprintf fmt "@[<6>NAME: %s@." (Typename.to_string name);
Format.fprintf fmt "@[<6>TYPE: %a@." (StructTyp.pp pe_text name) typ Format.fprintf fmt "@[<6>TYPE: %a@." (StructTyp.pp Pp.text name) typ
} }
) )
tenv; tenv;

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Module for Type Environments. */ /** Module for Type Environments. */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Types */ /** The Smallfoot Intermediate Language: Types */
@ -176,8 +176,8 @@ let pp pe f te =>
}; };
let to_string typ => { let to_string typ => {
let pp fmt () => pp_full pe_text fmt typ; let pp fmt => pp_full Pp.text fmt typ;
pp_to_string pp () F.asprintf "%t" pp
}; };

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Types */ /** The Smallfoot Intermediate Language: Types */
@ -92,11 +92,11 @@ let equal: t => t => bool;
/** Pretty print a type with all the details. */ /** Pretty print a type with all the details. */
let pp_full: printenv => F.formatter => t => unit; let pp_full: Pp.env => F.formatter => t => unit;
/** Pretty print a type. */ /** Pretty print a type. */
let pp: printenv => F.formatter => t => unit; let pp: Pp.env => F.formatter => t => unit;
let to_string: t => string; let to_string: t => string;

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
let module F = Format; let module F = Format;

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Named types. */ /** Named types. */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Unary Operators */ /** The Smallfoot Intermediate Language: Unary Operators */

@ -10,7 +10,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** The Smallfoot Intermediate Language: Unary Operators */ /** The Smallfoot Intermediate Language: Unary Operators */

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Attribute manipulation in Propositions (i.e., Symbolic Heaps) *) (** Attribute manipulation in Propositions (i.e., Symbolic Heaps) *)

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Attribute manipulation in Propositions (i.e., Symbolic Heaps) *) (** Attribute manipulation in Propositions (i.e., Symbolic Heaps) *)

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Models for the builtin functions supported *) (** Models for the builtin functions supported *)

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Models for the builtin functions supported *) (** Models for the builtin functions supported *)
include BUILTINS.S with type t = Builtin.registered include BUILTINS.S with type t = Builtin.registered

@ -7,7 +7,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Main module for the analysis after the capture phase */ /** Main module for the analysis after the capture phase */
@ -113,7 +113,7 @@ let main makefile => {
ClusterMakefile.create_cluster_makefile clusters makefile ClusterMakefile.create_cluster_makefile clusters makefile
} else { } else {
IList.iteri (fun i cluster => analyze_cluster i cluster) clusters; IList.iteri (fun i cluster => analyze_cluster i cluster) clusters;
L.stdout "@\nAnalysis finished in %as@." pp_elapsed_time () L.stdout "@\nAnalysis finished in %as@." Pp.elapsed_time ()
}; };
output_json_makefile_stats clusters output_json_makefile_stats clusters
} }

@ -7,7 +7,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Main module for the analysis after the capture phase */ /** Main module for the analysis after the capture phase */

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Main module for the analysis after the capture phase */ /** Main module for the analysis after the capture phase */
@ -21,8 +21,8 @@ let register_perf_stats_report () => {
}; };
let stats_base = Config.perf_stats_prefix ^ Filename.basename cluster ^ ".json"; let stats_base = Config.perf_stats_prefix ^ Filename.basename cluster ^ ".json";
let stats_file = Filename.concat stats_dir stats_base; let stats_file = Filename.concat stats_dir stats_base;
create_dir Config.results_dir; Utils.create_dir Config.results_dir;
create_dir stats_dir; Utils.create_dir stats_dir;
PerfStats.register_report_at_exit stats_file PerfStats.register_report_at_exit stats_file
}; };

@ -6,5 +6,5 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Main module for the analysis after the capture phase */ /** Main module for the analysis after the capture phase */

@ -7,7 +7,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
let module L = Logging; let module L = Logging;
@ -48,25 +48,25 @@ let begin_latex_file fmt => {
}; };
let error_desc_to_csv_string error_desc => { let error_desc_to_csv_string error_desc => {
let pp fmt () => F.fprintf fmt "%a" Localise.pp_error_desc error_desc; let pp fmt => F.fprintf fmt "%a" Localise.pp_error_desc error_desc;
Escape.escape_csv (pp_to_string pp ()) Escape.escape_csv (F.asprintf "%t" pp)
}; };
let error_advice_to_csv_string error_desc => { let error_advice_to_csv_string error_desc => {
let pp fmt () => F.fprintf fmt "%a" Localise.pp_error_advice error_desc; let pp fmt => F.fprintf fmt "%a" Localise.pp_error_advice error_desc;
Escape.escape_csv (pp_to_string pp ()) Escape.escape_csv (F.asprintf "%t" pp)
}; };
let error_desc_to_plain_string error_desc => { let error_desc_to_plain_string error_desc => {
let pp fmt () => F.fprintf fmt "%a" Localise.pp_error_desc error_desc; let pp fmt => F.fprintf fmt "%a" Localise.pp_error_desc error_desc;
pp_to_string pp () F.asprintf "%t" pp
}; };
let error_desc_to_dotty_string error_desc => Localise.error_desc_get_dotty error_desc; let error_desc_to_dotty_string error_desc => Localise.error_desc_get_dotty error_desc;
let error_desc_to_xml_string error_desc => { let error_desc_to_xml_string error_desc => {
let pp fmt () => F.fprintf fmt "%a" Localise.pp_error_desc error_desc; let pp fmt => F.fprintf fmt "%a" Localise.pp_error_desc error_desc;
Escape.escape_xml (pp_to_string pp ()) Escape.escape_xml (F.asprintf "%t" pp)
}; };
let error_desc_to_xml_tags error_desc => { let error_desc_to_xml_tags error_desc => {
@ -163,8 +163,8 @@ let summary_values top_proc_set summary => {
}; };
let proof_trace = { let proof_trace = {
let pp_line fmt l => F.fprintf fmt "%d" l; let pp_line fmt l => F.fprintf fmt "%d" l;
let pp fmt () => F.fprintf fmt "%a" (pp_seq pp_line) lines_visited; let pp fmt => F.fprintf fmt "%a" (Pp.seq pp_line) lines_visited;
pp_to_string pp () F.asprintf "%t" pp
}; };
let node_coverage = let node_coverage =
if (nodes_nr == 0) { if (nodes_nr == 0) {
@ -182,7 +182,7 @@ let summary_values top_proc_set summary => {
and c2 = 1; and c2 = 1;
logscale (c1 * in_calls + c2 * out_calls) logscale (c1 * in_calls + c2 * out_calls)
}; };
let pp_failure failure => pp_to_string SymOp.pp_failure_kind failure; let pp_failure failure => F.asprintf "%a" SymOp.pp_failure_kind failure;
{ {
vname: Procname.to_string proc_name, vname: Procname.to_string proc_name,
vname_id: Procname.to_filename proc_name, vname_id: Procname.to_filename proc_name,
@ -428,8 +428,8 @@ let module IssuesCsv = {
let xml_node = let xml_node =
Io_infer.Xml.create_tree Io_infer.Xml.create_tree
Io_infer.Xml.tag_qualifier_tags [] (error_desc_to_xml_tags error_desc); Io_infer.Xml.tag_qualifier_tags [] (error_desc_to_xml_tags error_desc);
let p fmt () => F.fprintf fmt "%a" (Io_infer.Xml.pp_document false) xml_node; let p fmt => F.fprintf fmt "%a" (Io_infer.Xml.pp_document false) xml_node;
let s = pp_to_string p (); let s = F.asprintf "%t" p;
Escape.escape_csv s Escape.escape_csv s
}; };
let kind = Exceptions.err_kind_string ekind; let kind = Exceptions.err_kind_string ekind;
@ -547,7 +547,7 @@ let pp_tests_of_report fmt report => {
let pp_trace fmt trace => let pp_trace fmt trace =>
if Config.print_traces_in_tests { if Config.print_traces_in_tests {
let trace_without_empty_descs = IList.filter (fun {description} => description != "") trace; let trace_without_empty_descs = IList.filter (fun {description} => description != "") trace;
F.fprintf fmt ", [%a]" (pp_comma_seq pp_trace_elem) trace_without_empty_descs F.fprintf fmt ", [%a]" (Pp.comma_seq pp_trace_elem) trace_without_empty_descs
}; };
let pp_row jsonbug => let pp_row jsonbug =>
F.fprintf F.fprintf
@ -791,13 +791,13 @@ let module Stats = {
| None => "" | None => ""
}; };
let line = { let line = {
let pp fmt () => { let pp fmt => {
if (description != "") { if (description != "") {
F.fprintf fmt "%s%4s // %s@\n" (indent_string (level + indent_num)) " " description F.fprintf fmt "%s%4s // %s@\n" (indent_string (level + indent_num)) " " description
}; };
F.fprintf fmt "%s%04d: %s" (indent_string (level + indent_num)) loc.Location.line code F.fprintf fmt "%s%04d: %s" (indent_string (level + indent_num)) loc.Location.line code
}; };
pp_to_string pp () F.asprintf "%t" pp
}; };
res := [line, "", ...!res] res := [line, "", ...!res]
}; };
@ -814,11 +814,11 @@ let module Stats = {
found_errors := true; found_errors := true;
stats.nerrors = stats.nerrors + 1; stats.nerrors = stats.nerrors + 1;
let error_strs = { let error_strs = {
let pp1 fmt () => F.fprintf fmt "%d: %s" stats.nerrors type_str; let pp1 fmt => F.fprintf fmt "%d: %s" stats.nerrors type_str;
let pp2 fmt () => let pp2 fmt =>
F.fprintf fmt " %a:%d" SourceFile.pp loc.Location.file loc.Location.line; F.fprintf fmt " %a:%d" SourceFile.pp loc.Location.file loc.Location.line;
let pp3 fmt () => F.fprintf fmt " (%a)" Localise.pp_error_desc error_desc; let pp3 fmt => F.fprintf fmt " (%a)" Localise.pp_error_desc error_desc;
[pp_to_string pp1 (), pp_to_string pp2 (), pp_to_string pp3 ()] [F.asprintf "%t" pp1, F.asprintf "%t" pp2, F.asprintf "%t" pp3]
}; };
let trace = loc_trace_to_string_list linereader 1 ltr; let trace = loc_trace_to_string_list linereader 1 ltr;
stats.saved_errors = IList.rev_append (error_strs @ trace @ [""]) stats.saved_errors stats.saved_errors = IList.rev_append (error_strs @ trace @ [""]) stats.saved_errors
@ -881,7 +881,7 @@ let module Stats = {
let module Report = { let module Report = {
let pp_header fmt () => { let pp_header fmt () => {
F.fprintf fmt "Infer Analysis Results -- generated %a@\n@\n" pp_current_time (); F.fprintf fmt "Infer Analysis Results -- generated %a@\n@\n" Pp.current_time ();
F.fprintf fmt "Summary Report@\n@\n" F.fprintf fmt "Summary Report@\n@\n"
}; };
let pp_stats fmt stats => Stats.pp fmt stats; let pp_stats fmt stats => Stats.pp fmt stats;
@ -919,8 +919,8 @@ let module Summary = {
not (DB.file_exists xml_file) || not (DB.file_exists xml_file) ||
DB.file_modified_time (DB.filename_from_string fname) > DB.file_modified_time xml_file DB.file_modified_time (DB.filename_from_string fname) > DB.file_modified_time xml_file
) { ) {
let xml_out = create_outfile (DB.filename_to_string xml_file); let xml_out = Utils.create_outfile (DB.filename_to_string xml_file);
do_outf Utils.do_outf
xml_out xml_out
( (
fun outf => { fun outf => {
@ -929,7 +929,7 @@ let module Summary = {
specs specs
summary.Specs.attributes.ProcAttributes.loc summary.Specs.attributes.ProcAttributes.loc
outf.fmt; outf.fmt;
close_outf outf Utils.close_outf outf
} }
) )
} }
@ -1017,7 +1017,7 @@ type bug_format_kind =
| Xml | Xml
| Latex; | Latex;
let pp_issues_in_format (format_kind, outf) => let pp_issues_in_format (format_kind, outf: Utils.outfile) =>
switch format_kind { switch format_kind {
| Json => IssuesJson.pp_issues_of_error_log outf.fmt | Json => IssuesJson.pp_issues_of_error_log outf.fmt
| Csv => IssuesCsv.pp_issues_of_error_log outf.fmt | Csv => IssuesCsv.pp_issues_of_error_log outf.fmt
@ -1027,7 +1027,7 @@ let pp_issues_in_format (format_kind, outf) =>
| Latex => failwith "Printing issues in latex is not implemented" | Latex => failwith "Printing issues in latex is not implemented"
}; };
let pp_procs_in_format (format_kind, outf) => let pp_procs_in_format (format_kind, outf: Utils.outfile) =>
switch format_kind { switch format_kind {
| Csv => ProcsCsv.pp_summary outf.fmt | Csv => ProcsCsv.pp_summary outf.fmt
| Xml => ProcsXml.pp_proc outf.fmt | Xml => ProcsXml.pp_proc outf.fmt
@ -1037,7 +1037,7 @@ let pp_procs_in_format (format_kind, outf) =>
| Text => failwith "Printing procs in json/latex/tests/text is not implemented" | Text => failwith "Printing procs in json/latex/tests/text is not implemented"
}; };
let pp_calls_in_format (format_kind, outf) => let pp_calls_in_format (format_kind, outf: Utils.outfile) =>
switch format_kind { switch format_kind {
| Csv => CallsCsv.pp_calls outf.fmt | Csv => CallsCsv.pp_calls outf.fmt
| Json | Json
@ -1057,7 +1057,7 @@ let pp_stats_in_format (format_kind, _) =>
| Latex => failwith "Printing stats in json/tests/text/xml/latex is not implemented" | Latex => failwith "Printing stats in json/tests/text/xml/latex is not implemented"
}; };
let pp_summary_in_format (format_kind, outf) => let pp_summary_in_format (format_kind, outf: Utils.outfile) =>
switch format_kind { switch format_kind {
| Latex => Summary.write_summary_latex outf.fmt | Latex => Summary.write_summary_latex outf.fmt
| Json | Json
@ -1137,10 +1137,10 @@ let pp_summary_by_report_kind
}; };
let pp_json_report_by_report_kind formats_by_report_kind fname => let pp_json_report_by_report_kind formats_by_report_kind fname =>
switch (read_file fname) { switch (Utils.read_file fname) {
| Some report_lines => | Some report_lines =>
let pp_json_issues format_list report => { let pp_json_issues format_list report => {
let pp_json_issue (format_kind, outf) => let pp_json_issue (format_kind, outf: Utils.outfile) =>
switch format_kind { switch format_kind {
| Tests => pp_tests_of_report outf.fmt report | Tests => pp_tests_of_report outf.fmt report
| Text => pp_text_of_report outf.fmt report | Text => pp_text_of_report outf.fmt report
@ -1319,7 +1319,7 @@ let register_perf_stats_report () => {
let mk_format format_kind fname => let mk_format format_kind fname =>
Option.value_map Option.value_map
f::(fun out_file => [(format_kind, out_file)]) default::[] (create_outfile fname); f::(fun out_file => [(format_kind, out_file)]) default::[] (Utils.create_outfile fname);
let init_issues_format_list report_csv report_json => { let init_issues_format_list report_csv report_json => {
let csv_format = Option.value_map f::(mk_format Csv) default::[] report_csv; let csv_format = Option.value_map f::(mk_format Csv) default::[] report_csv;
@ -1353,7 +1353,7 @@ let init_summary_format_list () => {
let init_files format_list_by_kind => { let init_files format_list_by_kind => {
let init_files_of_report_kind (report_kind, format_list) => { let init_files_of_report_kind (report_kind, format_list) => {
let init_files_of_format (format_kind, outfile) => let init_files_of_format (format_kind, outfile: Utils.outfile) =>
switch (format_kind, report_kind) { switch (format_kind, report_kind) {
| (Csv, Issues) => IssuesCsv.pp_header outfile.fmt () | (Csv, Issues) => IssuesCsv.pp_header outfile.fmt ()
| (Csv, Procs) => ProcsCsv.pp_header outfile.fmt () | (Csv, Procs) => ProcsCsv.pp_header outfile.fmt ()
@ -1371,7 +1371,7 @@ let init_files format_list_by_kind => {
let finalize_and_close_files format_list_by_kind stats pdflatex => { let finalize_and_close_files format_list_by_kind stats pdflatex => {
let close_files_of_report_kind (report_kind, format_list) => { let close_files_of_report_kind (report_kind, format_list) => {
let close_files_of_format (format_kind, outfile) => { let close_files_of_format (format_kind, outfile: Utils.outfile) => {
switch (format_kind, report_kind) { switch (format_kind, report_kind) {
| (Csv, Stats) => F.fprintf outfile.fmt "%a@?" Report.pp_stats stats | (Csv, Stats) => F.fprintf outfile.fmt "%a@?" Report.pp_stats stats
| (Json, Issues) => IssuesJson.pp_json_close outfile.fmt () | (Json, Issues) => IssuesJson.pp_json_close outfile.fmt ()
@ -1380,7 +1380,7 @@ let finalize_and_close_files format_list_by_kind stats pdflatex => {
| (Latex, Summary) => Latex.pp_end outfile.fmt () | (Latex, Summary) => Latex.pp_end outfile.fmt ()
| (Csv | Latex | Tests | Text | Xml | Json, _) => () | (Csv | Latex | Tests | Text | Xml | Json, _) => ()
}; };
close_outf outfile; Utils.close_outf outfile;
if ((format_kind, report_kind) == (Latex, Summary)) { if ((format_kind, report_kind) == (Latex, Summary)) {
pdflatex outfile.fname; pdflatex outfile.fname;
let pdf_name = Filename.chop_extension outfile.fname ^ ".pdf"; let pdf_name = Filename.chop_extension outfile.fname ^ ".pdf";

@ -6,6 +6,6 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
let main: report_csv::option string => report_json::option string => unit; let main: report_csv::option string => report_json::option string => unit;

@ -6,6 +6,6 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
let () = InferPrint.main report_csv::Config.bugs_csv report_json::Config.bugs_json; let () = InferPrint.main report_csv::Config.bugs_csv report_json::Config.bugs_json;

@ -6,4 +6,4 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;

@ -9,7 +9,7 @@
(** Performance Statistics gathering and reporting *) (** Performance Statistics gathering and reporting *)
open! Utils open! IStd
type perf_stats = { type perf_stats = {
rtime : float; rtime : float;
@ -122,11 +122,11 @@ let stats () =
let exit_times = Unix.times () in let exit_times = Unix.times () in
let at = AttributesTable.stats () in let at = AttributesTable.stats () in
{ {
rtime = exit_timeofday -. initial_timeofday; rtime = exit_timeofday -. Utils.initial_timeofday;
utime = exit_times.tms_utime -. initial_times.tms_utime; utime = exit_times.tms_utime -. Utils.initial_times.tms_utime;
stime = exit_times.tms_stime -. initial_times.tms_stime; stime = exit_times.tms_stime -. Utils.initial_times.tms_stime;
cutime = exit_times.tms_cutime -. initial_times.tms_cutime; cutime = exit_times.tms_cutime -. Utils.initial_times.tms_cutime;
cstime = exit_times.tms_cstime -. initial_times.tms_cstime; cstime = exit_times.tms_cstime -. Utils.initial_times.tms_cstime;
minor_gb = words_to_gb gc_stats.minor_words; minor_gb = words_to_gb gc_stats.minor_words;
promoted_gb = words_to_gb gc_stats.promoted_words; promoted_gb = words_to_gb gc_stats.promoted_words;
major_gb = words_to_gb gc_stats.major_words; major_gb = words_to_gb gc_stats.major_words;

@ -9,7 +9,7 @@
(** Performance Statistics gathering and reporting *) (** Performance Statistics gathering and reporting *)
open! Utils open! IStd
type perf_stats type perf_stats

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
let get_name_of_local (curr_f: Procdesc.t) (x, _) => Pvar.mk x (Procdesc.get_proc_name curr_f); let get_name_of_local (curr_f: Procdesc.t) (x, _) => Pvar.mk x (Procdesc.get_proc_name curr_f);

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** remove the return variable from the prop */ /** remove the return variable from the prop */

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
let aggregated_stats_filename = "aggregated_stats.json"; let aggregated_stats_filename = "aggregated_stats.json";
@ -173,9 +173,9 @@ let generate_files () => {
let aggregated_frontend_stats_dir = Filename.concat infer_out Config.frontend_stats_dir_name; let aggregated_frontend_stats_dir = Filename.concat infer_out Config.frontend_stats_dir_name;
let aggregated_backend_stats_dir = Filename.concat infer_out Config.backend_stats_dir_name; let aggregated_backend_stats_dir = Filename.concat infer_out Config.backend_stats_dir_name;
let aggregated_reporting_stats_dir = Filename.concat infer_out Config.reporting_stats_dir_name; let aggregated_reporting_stats_dir = Filename.concat infer_out Config.reporting_stats_dir_name;
create_dir aggregated_frontend_stats_dir; Utils.create_dir aggregated_frontend_stats_dir;
create_dir aggregated_backend_stats_dir; Utils.create_dir aggregated_backend_stats_dir;
create_dir aggregated_reporting_stats_dir; Utils.create_dir aggregated_reporting_stats_dir;
let write_to_json_file_opt destfile json => let write_to_json_file_opt destfile json =>
switch json { switch json {
| Some j => Utils.write_json_to_file destfile j | Some j => Utils.write_json_to_file destfile j

@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
open! Utils; open! IStd;
/** Generate files containing statistics aggregated from individual statistics files under /** Generate files containing statistics aggregated from individual statistics files under

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Implementation of Abstraction Functions *) (** Implementation of Abstraction Functions *)
@ -99,7 +99,7 @@ let mk_rule_ptspts_ls tenv impl_ok1 impl_ok2 (para: Sil.hpara) =
let (para_fst_start, para_fst_rest) = let (para_fst_start, para_fst_rest) =
let mark_impl_flag hpred = { Match.hpred = hpred; Match.flag = impl_ok1 } in let mark_impl_flag hpred = { Match.hpred = hpred; Match.flag = impl_ok1 } in
match para_fst with match para_fst with
| [] -> L.out "@.@.ERROR (Empty Para): %a @.@." (Sil.pp_hpara pe_text) para; assert false | [] -> L.out "@.@.ERROR (Empty Para): %a @.@." (Sil.pp_hpara Pp.text) para; assert false
| hpred :: hpreds -> | hpred :: hpreds ->
let hpat = mark_impl_flag hpred in let hpat = mark_impl_flag hpred in
let hpats = IList.map mark_impl_flag hpreds in let hpats = IList.map mark_impl_flag hpreds in
@ -128,7 +128,7 @@ let mk_rule_ptsls_ls tenv k2 impl_ok1 impl_ok2 para =
let (ids_exist, para_inst) = Sil.hpara_instantiate para exp_base exp_next exps_shared in let (ids_exist, para_inst) = Sil.hpara_instantiate para exp_base exp_next exps_shared in
let (para_inst_start, para_inst_rest) = let (para_inst_start, para_inst_rest) =
match para_inst with match para_inst with
| [] -> L.out "@.@.ERROR (Empty Para): %a @.@." (Sil.pp_hpara pe_text) para; assert false | [] -> L.out "@.@.ERROR (Empty Para): %a @.@." (Sil.pp_hpara Pp.text) para; assert false
| hpred :: hpreds -> | hpred :: hpreds ->
let allow_impl hpred = { Match.hpred = hpred; Match.flag = impl_ok1 } in let allow_impl hpred = { Match.hpred = hpred; Match.flag = impl_ok1 } in
(allow_impl hpred, IList.map allow_impl hpreds) in (allow_impl hpred, IList.map allow_impl hpreds) in
@ -252,7 +252,7 @@ let mk_rule_ptspts_dll tenv impl_ok1 impl_ok2 para =
let (para_fst_start, para_fst_rest) = let (para_fst_start, para_fst_rest) =
let mark_impl_flag hpred = { Match.hpred = hpred; Match.flag = impl_ok1 } in let mark_impl_flag hpred = { Match.hpred = hpred; Match.flag = impl_ok1 } in
match para_fst with match para_fst with
| [] -> L.out "@.@.ERROR (Empty DLL para): %a@.@." (Sil.pp_hpara_dll pe_text) para; assert false | [] -> L.out "@.@.ERROR (Empty DLL para): %a@.@." (Sil.pp_hpara_dll Pp.text) para; assert false
| hpred :: hpreds -> | hpred :: hpreds ->
let hpat = mark_impl_flag hpred in let hpat = mark_impl_flag hpred in
let hpats = IList.map mark_impl_flag hpreds in let hpats = IList.map mark_impl_flag hpreds in

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Implementation of Abstraction Functions *) (** Implementation of Abstraction Functions *)

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Abstraction for Arrays *) (** Abstraction for Arrays *)

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Abstraction for Arrays *) (** Abstraction for Arrays *)

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Classify bugs into buckets *) (** Classify bugs into buckets *)

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Classify bugs into buckets *) (** Classify bugs into buckets *)

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Module for builtin functions with their symbolic execution handler *) (** Module for builtin functions with their symbolic execution handler *)

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Module for builtin functions with their symbolic execution handler *) (** Module for builtin functions with their symbolic execution handler *)

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
module L = Logging module L = Logging

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Module to register and invoke callbacks *) (** Module to register and invoke callbacks *)

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
module L = Logging module L = Logging
module F = Format module F = Format

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
module F = Format module F = Format

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
module L = Logging module L = Logging
module F = Format module F = Format

@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
module F = Format module F = Format
module L = Logging module L = Logging
@ -83,7 +83,7 @@ let collect_all_summaries root_summaries_dir stacktrace_file stacktraces_dir =
| None -> None | None -> None
| Some file -> | Some file ->
let crashcontext_dir = Config.results_dir // "crashcontext" in let crashcontext_dir = Config.results_dir // "crashcontext" in
create_dir crashcontext_dir; Utils.create_dir crashcontext_dir;
Some (file, crashcontext_dir // "crashcontext.json") in Some (file, crashcontext_dir // "crashcontext.json") in
let trace_file_regexp = Str.regexp "\\(.*\\)\\.json" in let trace_file_regexp = Str.regexp "\\(.*\\)\\.json" in
let pairs_for_stactrace_dir = match stacktraces_dir with let pairs_for_stactrace_dir = match stacktraces_dir with

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Operators for the abstract domain. In particular, join and meet. *) (** Operators for the abstract domain. In particular, join and meet. *)

@ -8,7 +8,7 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open! Utils open! IStd
(** Join and Meet Operators *) (** Join and Meet Operators *)

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save