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]

[RFA][lto merge]: support for %E in default_tree_printer


This is another feature that will be needed by LTO.  When the
front ends disappear, the default tree printer ends up receiving
requests for %E when handling diagnostics.

This patch adds support for it.  In the end this was preferable
to the other alternatives, full thread here:
http://gcc.gnu.org/ml/gcc-patches/2008-11/msg01100.html

OK for mainline?


Thanks.  Diego.


2009-04-17  Simon Baldwin  <simonb@google.com>

	* toplev.c (default_tree_printer): Add handling for %E format.

Index: toplev.c
===================================================================
--- toplev.c	(revision 146277)
+++ toplev.c	(working copy)
@@ -1508,6 +1508,15 @@ default_tree_printer (pretty_printer * p

   switch (*spec)
     {
+    case 'E':
+      t = va_arg (*text->args_ptr, tree);
+      if (TREE_CODE (t) == IDENTIFIER_NODE)
+	{
+	  pp_string (pp, IDENTIFIER_POINTER (t));
+	  return true;
+	}
+      break;
+
     case 'D':
       t = va_arg (*text->args_ptr, tree);
       if (DECL_DEBUG_EXPR_IS_FROM (t) && DECL_DEBUG_EXPR (t))


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