From 2b08bc4e74ad382b2670931540f469c29aca094b Mon Sep 17 00:00:00 2001 From: Sam Blackshear Date: Fri, 13 Oct 2017 15:28:31 -0700 Subject: [PATCH] [cleanup] make it possible to print FormalMap's Reviewed By: ngorogiannis Differential Revision: D6054161 fbshipit-source-id: a1f41d2 --- infer/src/absint/FormalMap.ml | 2 ++ infer/src/absint/FormalMap.mli | 3 +++ 2 files changed, 5 insertions(+) diff --git a/infer/src/absint/FormalMap.ml b/infer/src/absint/FormalMap.ml index 1d00943b5..354d8cb67 100644 --- a/infer/src/absint/FormalMap.ml +++ b/infer/src/absint/FormalMap.ml @@ -40,3 +40,5 @@ let get_formal_base index t = |> Option.map ~f:fst let get_formals_indexes = AccessPath.BaseMap.bindings + +let pp = AccessPath.BaseMap.pp ~pp_value:Int.pp diff --git a/infer/src/absint/FormalMap.mli b/infer/src/absint/FormalMap.mli index 2461a2a45..8c83b3f95 100644 --- a/infer/src/absint/FormalMap.mli +++ b/infer/src/absint/FormalMap.mli @@ -31,3 +31,6 @@ val get_formal_base : int -> t -> AccessPath.base option linear in the size of the formal map *) val get_formals_indexes : t -> (AccessPath.base * int) list +(** Get a list of (base * index) pairs. Note: these are sorted by base, not index *) + +val pp : F.formatter -> t -> unit