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]

Patch: un-break dumping of function bodies


I was sent some private email saying that my earlier patch:

2007-09-17  Tom Tromey  <tromey@redhat.com>

	* c-decl.c (pushdecl): Don't set DECL_LANG_SPECIFIC.
	(c_builtin_function): Likewise.
	(grokdeclarator): Likewise.

... broke dumping of function bodies.

Sure enough, tree-dump.c checks DECL_LANG_SPECIFIC, and the body
doesn't appear in the dump.  This doesn't make sense to me, so this
patch changes this code to test DECL_SAVED_TREE instead.

Bootstrapped and regtested on x86 FC-6.  Ok?

Tom

ChangeLog:
2008-02-26  Tom Tromey  <tromey@redhat.com>

	* tree-dump.c (dequeue_and_dump) <FUNCTION_DECL>: Check
	DECL_SAVED_TREE, not DECL_LANG_SPECIFIC, when dumping body.

Index: tree-dump.c
===================================================================
--- tree-dump.c	(revision 132678)
+++ tree-dump.c	(working copy)
@@ -1,5 +1,5 @@
 /* Tree-dumping functionality for intermediate representation.
-   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007
+   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
    Written by Mark Mitchell <mark@codesourcery.com>
 
@@ -550,7 +550,7 @@
 	dump_string_field (di, "link", "extern");
       else
 	dump_string_field (di, "link", "static");
-      if (DECL_LANG_SPECIFIC (t) && !dump_flag (di, TDF_SLIM, t))
+      if (DECL_SAVED_TREE (t) && !dump_flag (di, TDF_SLIM, t))
 	dump_child ("body", DECL_SAVED_TREE (t));
       break;
 


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