diff mbox

C++ PATCH to ptree.c

Message ID CADzB+2=gYKixVsoiorpuXH=O45j7mScuquj0fwrvF3ZTR4s5HQ@mail.gmail.com
State New
Headers show

Commit Message

Jason Merrill Dec. 21, 2016, 7:08 p.m. UTC
A couple of things I was missing from debug_tree output.

Tested x86_64-pc-linux-gnu, applying to trunk.
commit 1742299fdad0ac883636af88ea364eec5fec2687
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Dec 15 10:01:05 2016 -0500

    Improve C++ debug_tree.
    
            * ptree.c (cxx_print_type): Print args of
            BOUND_TEMPLATE_TEMPLATE_PARM.
            (cxx_print_decl): Print DECL_TEMPLATE_PARMS.
diff mbox

Patch

diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c
index e3e5e33..67a4ee8 100644
--- a/gcc/cp/ptree.c
+++ b/gcc/cp/ptree.c
@@ -50,6 +50,7 @@  cxx_print_decl (FILE *file, tree node, int indent)
     }
   else if (TREE_CODE (node) == TEMPLATE_DECL)
     {
+      print_node (file, "parms", DECL_TEMPLATE_PARMS (node), indent + 4);
       indent_to (file, indent + 3);
       fprintf (file, " full-name \"%s\"",
 	       decl_as_string (node, TFF_TEMPLATE_HEADER));
@@ -73,9 +74,12 @@  cxx_print_type (FILE *file, tree node, int indent)
 {
   switch (TREE_CODE (node))
     {
+    case BOUND_TEMPLATE_TEMPLATE_PARM:
+      print_node (file, "args", TYPE_TI_ARGS (node), indent + 4);
+      gcc_fallthrough ();
+
     case TEMPLATE_TYPE_PARM:
     case TEMPLATE_TEMPLATE_PARM:
-    case BOUND_TEMPLATE_TEMPLATE_PARM:
       indent_to (file, indent + 3);
       fprintf (file, "index %d level %d orig_level %d",
 	       TEMPLATE_TYPE_IDX (node), TEMPLATE_TYPE_LEVEL (node),