diff mbox

C++ PATCH to improve print_tree for TEMPLATE_INFO nodes

Message ID 4C40C68E.7030908@redhat.com
State New
Headers show

Commit Message

Jason Merrill July 16, 2010, 8:52 p.m. UTC
I noticed we weren't doing this, and the default behavior didn't print 
the TREE_CHAIN.

Tested x86_64-pc-linux-gnu, applying to trunk.
diff mbox

Patch

commit 8a9510b8fe8fb127ed2f8e3f50e5a97d0a9c92ec
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Jul 16 12:19:08 2010 -0400

    	* ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.

diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c
index c2493c7..ee3f52f 100644
--- a/gcc/cp/ptree.c
+++ b/gcc/cp/ptree.c
@@ -207,6 +207,15 @@  cxx_print_xnode (FILE *file, tree node, int indent)
 	       TEMPLATE_PARM_IDX (node), TEMPLATE_PARM_LEVEL (node),
 	       TEMPLATE_PARM_ORIG_LEVEL (node));
       break;
+    case TEMPLATE_INFO:
+      print_node (file, "template", TI_TEMPLATE (node), indent+4);
+      print_node (file, "args", TI_ARGS (node), indent+4);
+      if (TI_PENDING_TEMPLATE_FLAG (node))
+	{
+	  indent_to (file, indent + 3);
+	  fprintf (file, "pending_template");
+	}
+      break;
     default:
       break;
     }