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 to dbxout_typedefs


The recursion to emit the typedefs in reverse order is
both inefficient and seemingly wrong.  (It emits builtin
typedefs in the wrong order.)  I suspect it is a remnant
from when the incoming list was in reverse order, but I
think someone (Zack?) may have changed that.

I've done a bootstrap on this and visually compared the
output assembler for a test file.  I haven't tried to
run the gdb testsuite.  (That would be painful because
Linux at least by default no longer uses stabs, and FSF
gdb won't build on Mac OSX.)

Ok to check in?
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


2003-09-12  Per Bothner  <pbothner@apple.com>

	* dbxout.c (dbxout_typedefs):  Output typedefs in forward order.
	No longer any need to reverse by recursion.

Index: dbxout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.156.2.1
diff -u -p -r1.156.2.1 dbxout.c
--- dbxout.c	12 Aug 2003 23:06:54 -0000	1.156.2.1
+++ dbxout.c	12 Sep 2003 21:27:47 -0000
@@ -541,15 +541,13 @@ dbxout_init (const char *input_file_name
   dbxout_typedefs (syms);
 }
 
-/* Output any typedef names for types described by TYPE_DECLs in SYMS,
-   in the reverse order from that which is found in SYMS.  */
+/* Output any typedef names for types described by TYPE_DECLs in SYMS. */
 
 static void
 dbxout_typedefs (tree syms)
 {
-  if (syms)
+  for (; syms != NULL_TREE; syms = TREE_CHAIN (syms))
     {
-      dbxout_typedefs (TREE_CHAIN (syms));
       if (TREE_CODE (syms) == TYPE_DECL)
 	{
 	  tree type = TREE_TYPE (syms);

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