public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-8673] analyzer: show types for poisoned_svalue and compound_svalue
@ 2021-07-02 19:21 David Malcolm
  0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2021-07-02 19:21 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7b2c2f3130202c571b1014e0461ae58310d5b562

commit r11-8673-g7b2c2f3130202c571b1014e0461ae58310d5b562
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Fri Jul 2 15:19:44 2021 -0400

    analyzer: show types for poisoned_svalue and compound_svalue
    
    gcc/analyzer/ChangeLog:
            * svalue.cc (poisoned_svalue::dump_to_pp): Dump type.
            (compound_svalue::dump_to_pp): Dump any type.
    
    Signed-off-by: David Malcolm <dmalcolm@redhat.com>

Diff:
---
 gcc/analyzer/svalue.cc | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/gcc/analyzer/svalue.cc b/gcc/analyzer/svalue.cc
index 897e84e8464..a16563d912a 100644
--- a/gcc/analyzer/svalue.cc
+++ b/gcc/analyzer/svalue.cc
@@ -735,9 +735,17 @@ void
 poisoned_svalue::dump_to_pp (pretty_printer *pp, bool simple) const
 {
   if (simple)
-    pp_printf (pp, "POISONED(%s)", poison_kind_to_str (m_kind));
+    {
+      pp_string (pp, "POISONED(");
+      print_quoted_type (pp, get_type ());
+      pp_printf (pp, ", %s)", poison_kind_to_str (m_kind));
+    }
   else
-    pp_printf (pp, "poisoned_svalue(%s)", poison_kind_to_str (m_kind));
+    {
+      pp_string (pp, "poisoned_svalue(");
+      print_quoted_type (pp, get_type ());
+      pp_printf (pp, ", %s)", poison_kind_to_str (m_kind));
+    }
 }
 
 /* Implementation of svalue::accept vfunc for poisoned_svalue.  */
@@ -1228,17 +1236,26 @@ compound_svalue::dump_to_pp (pretty_printer *pp, bool simple) const
   if (simple)
     {
       pp_string (pp, "COMPOUND(");
+      if (get_type ())
+	{
+	  print_quoted_type (pp, get_type ());
+	  pp_string (pp, ", ");
+	}
+      pp_character (pp, '{');
       m_map.dump_to_pp (pp, simple, false);
-      pp_character (pp, ')');
+      pp_string (pp, "})");
     }
   else
     {
       pp_string (pp, "compound_svalue (");
-      pp_string (pp, ", ");
+      if (get_type ())
+	{
+	  print_quoted_type (pp, get_type ());
+	  pp_string (pp, ", ");
+	}
       pp_character (pp, '{');
       m_map.dump_to_pp (pp, simple, false);
-      pp_string (pp, "}, ");
-      pp_character (pp, ')');
+      pp_string (pp, "})");
     }
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-02 19:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02 19:21 [gcc r11-8673] analyzer: show types for poisoned_svalue and compound_svalue David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).