This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++ PATCH to print_tree TRAIT_EXPR


I noticed that debug_tree wasn't printing the types or code of a TRAIT_EXPR, so this fixes that. I'm not bothering to turn the kind into an enum name at the moment.

Tested x86_64-pc-linux-gnu, applying to trunk.
commit 6baa86e88580ee3e4f5a322fc530427169da2227
Author: Jason Merrill <jason@redhat.com>
Date:   Fri May 15 15:27:51 2015 -0400

    	* ptree.c (cxx_print_xnode): Handle TRAIT_EXPR.

diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c
index 2d0b584..fd71bb4 100644
--- a/gcc/cp/ptree.c
+++ b/gcc/cp/ptree.c
@@ -271,6 +271,13 @@ cxx_print_xnode (FILE *file, tree node, int indent)
       print_node (file, "pattern", DEFERRED_NOEXCEPT_PATTERN (node), indent+4);
       print_node (file, "args", DEFERRED_NOEXCEPT_ARGS (node), indent+4);
       break;
+    case TRAIT_EXPR:
+      indent_to (file, indent+4);
+      fprintf (file, "kind %d", TRAIT_EXPR_KIND (node));
+      print_node (file, "type 1", TRAIT_EXPR_TYPE1 (node), indent+4);
+      if (TRAIT_EXPR_TYPE2 (node))
+	print_node (file, "type 2", TRAIT_EXPR_TYPE2 (node), indent+4);
+      break;
     case LAMBDA_EXPR:
       cxx_print_lambda_node (file, node, indent);
       break;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]