analyzer: fix more pointer-printing in logs
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 29 Oct 2020 00:07:35 +0000 (20:07 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Thu, 29 Oct 2020 00:07:35 +0000 (20:07 -0400)
gcc/analyzer/ChangeLog:
* program-state.cc (sm_state_map::print): Guard the printing of
the origin pointer with !flag_dump_noaddr.
* region.cc (string_region::dump_to_pp): Likewise for
m_string_cst.

gcc/analyzer/program-state.cc
gcc/analyzer/region.cc

index 6a91554..7d719b1 100644 (file)
@@ -224,8 +224,11 @@ sm_state_map::print (const region_model *model,
       if (e.m_origin)
        {
          pp_string (pp, " (origin: ");
-         pp_pointer (pp, e.m_origin);
-         pp_string (pp, ": ");
+         if (!flag_dump_noaddr)
+           {
+             pp_pointer (pp, e.m_origin);
+             pp_string (pp, ": ");
+           }
          e.m_origin->dump_to_pp (pp, simple);
          if (model)
            if (tree rep = model->get_representative_tree (e.m_origin))
index c43fb78..ed68a22 100644 (file)
@@ -1135,9 +1135,12 @@ string_region::dump_to_pp (pretty_printer *pp, bool simple) const
     {
       pp_string (pp, "string_region(");
       dump_tree (pp, m_string_cst);
-      pp_string (pp, " (");
-      pp_pointer (pp, m_string_cst);
-      pp_string (pp, "))");
+      if (!flag_dump_noaddr)
+       {
+         pp_string (pp, " (");
+         pp_pointer (pp, m_string_cst);
+         pp_string (pp, "))");
+       }
     }
 }