aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2023-08-04 16:17:12 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2023-08-04 16:17:12 -0400
commit187b213ddbe7ea7a3180f6ca3188732999729623 (patch)
tree7d43accc8f84e8762bd5f065ba1c819584c09e5a
parent567d06bb357a39ece865cef67ada44124f227e45 (diff)
downloadgcc-187b213ddbe7ea7a3180f6ca3188732999729623.zip
gcc-187b213ddbe7ea7a3180f6ca3188732999729623.tar.gz
gcc-187b213ddbe7ea7a3180f6ca3188732999729623.tar.bz2
analyzer: fix some svalue::dump_to_pp implementations
gcc/analyzer/ChangeLog: * svalue.cc (region_svalue::dump_to_pp): Support NULL type. (constant_svalue::dump_to_pp): Likewise. (initial_svalue::dump_to_pp): Likewise. (conjured_svalue::dump_to_pp): Likewise. Fix missing print of the type. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
-rw-r--r--gcc/analyzer/svalue.cc27
1 files changed, 20 insertions, 7 deletions
diff --git a/gcc/analyzer/svalue.cc b/gcc/analyzer/svalue.cc
index 4395018..5d5c80f 100644
--- a/gcc/analyzer/svalue.cc
+++ b/gcc/analyzer/svalue.cc
@@ -714,8 +714,11 @@ region_svalue::dump_to_pp (pretty_printer *pp, bool simple) const
else
{
pp_string (pp, "region_svalue(");
- print_quoted_type (pp, get_type ());
- pp_string (pp, ", ");
+ if (get_type ())
+ {
+ print_quoted_type (pp, get_type ());
+ pp_string (pp, ", ");
+ }
m_reg->dump_to_pp (pp, simple);
pp_string (pp, ")");
}
@@ -811,8 +814,11 @@ constant_svalue::dump_to_pp (pretty_printer *pp, bool simple) const
else
{
pp_string (pp, "constant_svalue(");
- print_quoted_type (pp, get_type ());
- pp_string (pp, ", ");
+ if (get_type ())
+ {
+ print_quoted_type (pp, get_type ());
+ pp_string (pp, ", ");
+ }
dump_tree (pp, m_cst_expr);
pp_string (pp, ")");
}
@@ -1029,8 +1035,11 @@ initial_svalue::dump_to_pp (pretty_printer *pp, bool simple) const
else
{
pp_string (pp, "initial_svalue(");
- print_quoted_type (pp, get_type ());
- pp_string (pp, ", ");
+ if (get_type ())
+ {
+ print_quoted_type (pp, get_type ());
+ pp_string (pp, ", ");
+ }
m_reg->dump_to_pp (pp, simple);
pp_string (pp, ")");
}
@@ -1910,7 +1919,11 @@ conjured_svalue::dump_to_pp (pretty_printer *pp, bool simple) const
else
{
pp_string (pp, "conjured_svalue (");
- pp_string (pp, ", ");
+ if (get_type ())
+ {
+ print_quoted_type (pp, get_type ());
+ pp_string (pp, ", ");
+ }
pp_gimple_stmt_1 (pp, m_stmt, 0, (dump_flags_t)0);
pp_string (pp, ", ");
m_id_reg->dump_to_pp (pp, simple);