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]

Fix sdbout.c breakage


This fixes some sdbout.c problems with occured with the DECL_ASSEMBLER_NAME
changes, but they are latent bugs which are independent.  Committed to both
branch and mainline.

Wed Mar 21 14:27:11 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* sdbout.c: #include ggc.h.
 	(sdbout_init): Move to end of file.
	Call ggc_add_tree_root for anonymous_types.
	(sdbout_symbol): Use DECL_NAME for local, not DECL_ASSEMBLER_NAME.
	(sdbout_one_type): Use DECL_NAME for field name.
	* Makefile.in (sdbout.o): Show includes ggc.h.

*** Makefile.in	2001/03/20 18:22:38	1.626
--- Makefile.in	2001/03/21 19:07:13
*************** dbxout.o : dbxout.c $(CONFIG_H) system.h
*** 1411,1415 ****
  sdbout.o : sdbout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h except.h \
     function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) real.h \
!    insn-config.h $(OBSTACK_H) xcoffout.h c-pragma.h \
     sdbout.h toplev.h $(TM_P_H)
  dwarfout.o : dwarfout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf.h \
--- 1411,1415 ----
  sdbout.o : sdbout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h except.h \
     function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) real.h \
!    insn-config.h $(OBSTACK_H) xcoffout.h c-pragma.h ggc.h \
     sdbout.h toplev.h $(TM_P_H)
  dwarfout.o : dwarfout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf.h \
*** sdbout.c	2001/03/15 20:48:48	1.40
--- sdbout.c	2001/03/21 19:08:14
*************** AT&T C compiler.  From the example below
*** 55,58 ****
--- 55,59 ----
  #include "output.h"
  #include "toplev.h"
+ #include "ggc.h"
  #include "tm_p.h"
  
*************** static struct sdb_file *current_file;
*** 302,328 ****
  #endif /* MIPS_DEBUGGING_INFO */
  
- /* Set up for SDB output at the start of compilation.  */
- 
- void
- sdbout_init (asm_file, input_file_name, syms)
-      FILE *asm_file ATTRIBUTE_UNUSED;
-      const char *input_file_name ATTRIBUTE_UNUSED;
-      tree syms ATTRIBUTE_UNUSED;
- {
- #ifdef MIPS_DEBUGGING_INFO
-   current_file = (struct sdb_file *) xmalloc (sizeof *current_file);
-   current_file->next = NULL;
-   current_file->name = input_file_name;
- #endif
  
- #ifdef RMS_QUICK_HACK_1
-   tree t;
-   for (t = syms; t; t = TREE_CHAIN (t))
-     if (DECL_NAME (t) && IDENTIFIER_POINTER (DECL_NAME (t)) != 0
- 	&& !strcmp (IDENTIFIER_POINTER (DECL_NAME (t)), "__vtbl_ptr_type"))
-       sdbout_symbol (t, 0);
- #endif  
- }
- 
  #if 0
  
--- 303,307 ----
*************** sdbout_symbol (decl, local)
*** 845,849 ****
  
        /* Record the name for, starting a symtab entry.  */
!       name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
  
        if (GET_CODE (value) == MEM
--- 824,831 ----
  
        /* Record the name for, starting a symtab entry.  */
!       if (local)
! 	name = IDENTIFIER_POINTER (DECL_NAME (decl));
!       else
! 	name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
  
        if (GET_CODE (value) == MEM
*************** sdbout_one_type (type)
*** 1248,1252 ****
  
  		CONTIN;
! 		name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (tem));
  		PUT_SDB_DEF (name);
  		if (DECL_BIT_FIELD_TYPE (tem))
--- 1230,1234 ----
  
  		CONTIN;
! 		name = IDENTIFIER_POINTER (DECL_NAME (tem));
  		PUT_SDB_DEF (name);
  		if (DECL_BIT_FIELD_TYPE (tem))
*************** sdbout_resume_previous_source_file ()
*** 1640,1643 ****
--- 1622,1652 ----
    current_file = next;
    PUT_SDB_SRC_FILE (current_file->name);
+ #endif
+ }
+ 
+ /* Set up for SDB output at the start of compilation.  */
+ 
+ void
+ sdbout_init (asm_file, input_file_name, syms)
+      FILE *asm_file ATTRIBUTE_UNUSED;
+      const char *input_file_name ATTRIBUTE_UNUSED;
+      tree syms ATTRIBUTE_UNUSED;
+ {
+ #ifdef MIPS_DEBUGGING_INFO
+   current_file = (struct sdb_file *) xmalloc (sizeof *current_file);
+   current_file->next = NULL;
+   current_file->name = input_file_name;
+ #endif
+ 
+ #ifdef RMS_QUICK_HACK_1
+   tree t;
+   for (t = syms; t; t = TREE_CHAIN (t))
+     if (DECL_NAME (t) && IDENTIFIER_POINTER (DECL_NAME (t)) != 0
+ 	&& !strcmp (IDENTIFIER_POINTER (DECL_NAME (t)), "__vtbl_ptr_type"))
+       sdbout_symbol (t, 0);
+ #endif  
+ 
+ #ifdef SDB_ALLOW_FORWARD_REFERENCES
+   ggc_add_tree_root (&anonymous_types, 1);
  #endif
  }


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