From 22c5acd2364cd320f2ed879a57f9874900b72762 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Fri, 30 Aug 2019 08:12:13 -0700 Subject: [PATCH] [pulse] utility method `PulseDomain.Memory.pp_edges` Summary: Useful for debugging, not used at the moment. Reviewed By: ngorogiannis Differential Revision: D17131275 fbshipit-source-id: 2edbdc517 --- infer/src/pulse/PulseDomain.ml | 10 +++++----- infer/src/pulse/PulseDomain.mli | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/infer/src/pulse/PulseDomain.ml b/infer/src/pulse/PulseDomain.ml index 12f98ed0c..9ca183b8f 100644 --- a/infer/src/pulse/PulseDomain.ml +++ b/infer/src/pulse/PulseDomain.ml @@ -418,6 +418,8 @@ module Memory : sig type edges = AddrTracePair.t Edges.t + val pp_edges : F.formatter -> edges -> unit + type cell = edges * Attributes.t type t @@ -474,17 +476,15 @@ end = struct type edges = AddrTracePair.t Edges.t [@@deriving compare] + let pp_edges = Edges.pp ~pp_value:AddrTracePair.pp + type cell = edges * Attributes.t module Graph = PrettyPrintable.MakePPMap (AbstractAddress) type t = edges Graph.t * Attributes.t Graph.t - let pp = - Pp.pair - ~fst:(Graph.pp ~pp_value:(Edges.pp ~pp_value:AddrTracePair.pp)) - ~snd:(Graph.pp ~pp_value:Attributes.pp) - + let pp = Pp.pair ~fst:(Graph.pp ~pp_value:pp_edges) ~snd:(Graph.pp ~pp_value:Attributes.pp) let register_address addr memory = if Graph.mem addr (fst memory) then memory diff --git a/infer/src/pulse/PulseDomain.mli b/infer/src/pulse/PulseDomain.mli index 07b4da2fe..b45e25715 100644 --- a/infer/src/pulse/PulseDomain.mli +++ b/infer/src/pulse/PulseDomain.mli @@ -145,6 +145,8 @@ module Memory : sig type edges = AddrTracePair.t Edges.t + val pp_edges : F.formatter -> edges -> unit [@@warning "-32"] + type cell = edges * Attributes.t type t