aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-pretty-print.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2017-11-15 03:11:48 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2017-11-15 03:11:48 +0000
commit171a55e7f52c1e51a85ce0e4dad550c310d1030e (patch)
tree4a2f16439b5d9964b8b0b04f7b84b25c3dfecac9 /gcc/tree-pretty-print.c
parent3267bd36aaf32ac4c88e5a4618067d9141fbfac7 (diff)
downloadgcc-171a55e7f52c1e51a85ce0e4dad550c310d1030e.zip
gcc-171a55e7f52c1e51a85ce0e4dad550c310d1030e.tar.gz
gcc-171a55e7f52c1e51a85ce0e4dad550c310d1030e.tar.bz2
introduce TDF_compare_debug, omit OBJ_TYPE_REF casts with it
for gcc/ChangeLog * dumpfile.h (TDF_COMPARE_DEBUG): New. * final.c (rest_of_clean_state): Set it for the -fcompare-debug dump. * tree-pretty-print.c (dump_generic_node): Omit OBJ_TYPE_REF class when TDF_COMPARE_DEBUG is set. From-SVN: r254751
Diffstat (limited to 'gcc/tree-pretty-print.c')
-rw-r--r--gcc/tree-pretty-print.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 61a28c6..80d45f9 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -2760,7 +2760,15 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
pp_string (pp, "OBJ_TYPE_REF(");
dump_generic_node (pp, OBJ_TYPE_REF_EXPR (node), spc, flags, false);
pp_semicolon (pp);
- if (!(flags & TDF_SLIM) && virtual_method_call_p (node))
+ /* We omit the class type for -fcompare-debug because we may
+ drop TYPE_BINFO early depending on debug info, and then
+ virtual_method_call_p would return false, whereas when
+ TYPE_BINFO is preserved it may still return true and then
+ we'd print the class type. Compare tree and rtl dumps for
+ libstdc++-prettyprinters/shared_ptr.cc with and without -g,
+ for example, at occurrences of OBJ_TYPE_REF. */
+ if (!(flags & (TDF_SLIM | TDF_COMPARE_DEBUG))
+ && virtual_method_call_p (node))
{
pp_string (pp, "(");
dump_generic_node (pp, obj_type_ref_class (node), spc, flags, false);