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 const-ify *debug_hooks + add missing debug.o dependency


This patch const-ifies the debug_hooks stuff.  I also noticed that
debug.o needed a dependency on debug.h.

Bootstrapped on sparc-sun-solaris2.7 with ada enabled.  No additional
const warnings.

Ok to install?

		Thanks,
		--Kaveh



2001-12-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* Makefile.in (debug.o): Depend on debug.h.
	* dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Const-ify.
	* debug.c (do_nothing_debug_hooks): Likewise.
	* debug.h (debug_hooks, do_nothing_debug_hooks, dbx_debug_hooks,
	sdb_debug_hooks, xcoff_debug_hooks, dwarf_debug_hooks,
	dwarf2_debug_hooks, vmsdbg_debug_hooks): Likewise.
	* dwarf2out.c (dwarf2_debug_hooks): Likewise.
	* dwarfout.c (dwarf_debug_hooks): Likewise.
	* integrate.c (output_inline_function): Likewise.
	* objc/objc-act.c (synth_module_prologue): Likewise.
	* sdbout.c (sdb_debug_hooks): Likewise.
	* toplev.c (debug_hooks): Likewise.
	* vmsdbgout.c (vmsdbg_debug_hooks): Likewise.
	
ada:
	* trans.c (tree_transform): Const-ify.

diff -rup orig/egcc-CVS20011223/gcc/Makefile.in egcc-CVS20011223/gcc/Makefile.in
--- orig/egcc-CVS20011223/gcc/Makefile.in	Sun Dec 23 18:15:46 2001
+++ egcc-CVS20011223/gcc/Makefile.in	Sun Dec 23 19:17:32 2001
@@ -1384,7 +1384,7 @@ optabs.o : optabs.c $(CONFIG_H) $(SYSTEM
 dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
     $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) function.h langhooks.h \
    insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h toplev.h
-debug.o : debug.c $(CONFIG_H) $(SYSTEM_H)
+debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H)
 sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.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 \
diff -rup orig/egcc-CVS20011223/gcc/ada/trans.c egcc-CVS20011223/gcc/ada/trans.c
--- orig/egcc-CVS20011223/gcc/ada/trans.c	Tue Dec 18 21:35:41 2001
+++ egcc-CVS20011223/gcc/ada/trans.c	Sun Dec 23 19:15:17 2001
@@ -2582,7 +2582,7 @@ tree_transform (gnat_node)
       {
         /* Save debug output mode in case it is reset.  */
         enum debug_info_type save_write_symbols = write_symbols;
-	struct gcc_debug_hooks *save_debug_hooks = debug_hooks;
+	const struct gcc_debug_hooks *const save_debug_hooks = debug_hooks;
 	/* Definining identifier of a parameter to the subprogram.  */
         Entity_Id gnat_param;
 	/* The defining identifier for the subprogram body. Note that if a
diff -rup orig/egcc-CVS20011223/gcc/dbxout.c egcc-CVS20011223/gcc/dbxout.c
--- orig/egcc-CVS20011223/gcc/dbxout.c	Sun Dec  9 11:28:51 2001
+++ egcc-CVS20011223/gcc/dbxout.c	Sun Dec 23 19:21:13 2001
@@ -326,7 +326,7 @@ static void dbxout_begin_block		PARAMS (
 static void dbxout_end_block		PARAMS ((unsigned, unsigned));
 static void dbxout_function_decl	PARAMS ((tree));
 
-struct gcc_debug_hooks dbx_debug_hooks =
+const struct gcc_debug_hooks dbx_debug_hooks =
 {
   dbxout_init,
   dbxout_finish,
@@ -356,7 +356,7 @@ struct gcc_debug_hooks dbx_debug_hooks =
 #endif /* DBX_DEBUGGING_INFO  */
 
 #if defined (XCOFF_DEBUGGING_INFO)
-struct gcc_debug_hooks xcoff_debug_hooks =
+const struct gcc_debug_hooks xcoff_debug_hooks =
 {
   dbxout_init,
   dbxout_finish,
diff -rup orig/egcc-CVS20011223/gcc/debug.c egcc-CVS20011223/gcc/debug.c
--- orig/egcc-CVS20011223/gcc/debug.c	Thu Jul 19 19:41:41 2001
+++ egcc-CVS20011223/gcc/debug.c	Sun Dec 23 19:10:54 2001
@@ -20,7 +20,7 @@ Foundation, 59 Temple Place - Suite 330,
 #include "debug.h"
 
 /* The do-nothing debug hooks.  */
-struct gcc_debug_hooks do_nothing_debug_hooks =
+const struct gcc_debug_hooks do_nothing_debug_hooks =
 {
   debug_nothing_charstar,
   debug_nothing_charstar,
diff -rup orig/egcc-CVS20011223/gcc/debug.h egcc-CVS20011223/gcc/debug.h
--- orig/egcc-CVS20011223/gcc/debug.h	Sun Dec  2 12:41:27 2001
+++ egcc-CVS20011223/gcc/debug.h	Sun Dec 23 19:18:06 2001
@@ -106,7 +106,7 @@ struct gcc_debug_hooks
   void (* label) PARAMS ((struct rtx_def *insn));
 };
 
-extern struct gcc_debug_hooks *debug_hooks;
+extern const struct gcc_debug_hooks *debug_hooks;
 
 /* The do-nothing hooks.  */
 extern void debug_nothing_void
@@ -127,13 +127,13 @@ extern void debug_nothing_rtx
   PARAMS ((struct rtx_def *));
 
 /* Hooks for various debug formats.  */
-extern struct gcc_debug_hooks do_nothing_debug_hooks;
-extern struct gcc_debug_hooks dbx_debug_hooks;
-extern struct gcc_debug_hooks sdb_debug_hooks;
-extern struct gcc_debug_hooks xcoff_debug_hooks;
-extern struct gcc_debug_hooks dwarf_debug_hooks;
-extern struct gcc_debug_hooks dwarf2_debug_hooks;
-extern struct gcc_debug_hooks vmsdbg_debug_hooks;
+extern const struct gcc_debug_hooks do_nothing_debug_hooks;
+extern const struct gcc_debug_hooks dbx_debug_hooks;
+extern const struct gcc_debug_hooks sdb_debug_hooks;
+extern const struct gcc_debug_hooks xcoff_debug_hooks;
+extern const struct gcc_debug_hooks dwarf_debug_hooks;
+extern const struct gcc_debug_hooks dwarf2_debug_hooks;
+extern const struct gcc_debug_hooks vmsdbg_debug_hooks;
 
 /* Dwarf2 frame information.  */
 
diff -rup orig/egcc-CVS20011223/gcc/dwarf2out.c egcc-CVS20011223/gcc/dwarf2out.c
--- orig/egcc-CVS20011223/gcc/dwarf2out.c	Sat Dec 22 15:32:50 2001
+++ egcc-CVS20011223/gcc/dwarf2out.c	Sun Dec 23 19:13:53 2001
@@ -3030,7 +3030,7 @@ static void dwarf2out_abstract_function 
 
 /* The debug hooks structure.  */
 
-struct gcc_debug_hooks dwarf2_debug_hooks =
+const struct gcc_debug_hooks dwarf2_debug_hooks =
 {
   dwarf2out_init,
   dwarf2out_finish,
diff -rup orig/egcc-CVS20011223/gcc/dwarfout.c egcc-CVS20011223/gcc/dwarfout.c
--- orig/egcc-CVS20011223/gcc/dwarfout.c	Mon Dec 17 11:33:11 2001
+++ egcc-CVS20011223/gcc/dwarfout.c	Sun Dec 23 19:13:46 2001
@@ -1298,7 +1298,7 @@ static void retry_incomplete_types	PARAM
 
 
 /* The debug hooks structure.  */
-struct gcc_debug_hooks dwarf_debug_hooks =
+const struct gcc_debug_hooks dwarf_debug_hooks =
 {
   dwarfout_init,
   dwarfout_finish,
diff -rup orig/egcc-CVS20011223/gcc/integrate.c egcc-CVS20011223/gcc/integrate.c
--- orig/egcc-CVS20011223/gcc/integrate.c	Thu Nov 15 07:30:28 2001
+++ egcc-CVS20011223/gcc/integrate.c	Sun Dec 23 19:16:10 2001
@@ -2924,7 +2924,7 @@ output_inline_function (fndecl)
 {
   struct function *old_cfun = cfun;
   enum debug_info_type old_write_symbols = write_symbols;
-  struct gcc_debug_hooks *old_debug_hooks = debug_hooks;
+  const struct gcc_debug_hooks *const old_debug_hooks = debug_hooks;
   struct function *f = DECL_SAVED_INSNS (fndecl);
 
   cfun = f;
diff -rup orig/egcc-CVS20011223/gcc/objc/objc-act.c egcc-CVS20011223/gcc/objc/objc-act.c
--- orig/egcc-CVS20011223/gcc/objc/objc-act.c	Mon Dec 17 21:26:53 2001
+++ egcc-CVS20011223/gcc/objc/objc-act.c	Sun Dec 23 19:15:06 2001
@@ -1179,7 +1179,7 @@ synth_module_prologue ()
 	  /* Suppress outputting debug symbols, because
 	     dbxout_init hasn'r been called yet.  */
 	  enum debug_info_type save_write_symbols = write_symbols;
-	  struct gcc_debug_hooks *save_hooks = debug_hooks;
+	  const struct gcc_debug_hooks *const save_hooks = debug_hooks;
 	  write_symbols = NO_DEBUG;
 	  debug_hooks = &do_nothing_debug_hooks;
 
diff -rup orig/egcc-CVS20011223/gcc/sdbout.c egcc-CVS20011223/gcc/sdbout.c
--- orig/egcc-CVS20011223/gcc/sdbout.c	Sun Nov 18 16:30:11 2001
+++ egcc-CVS20011223/gcc/sdbout.c	Sun Dec 23 19:21:46 2001
@@ -299,7 +299,7 @@ static struct sdb_file *current_file;
 #endif /* MIPS_DEBUGGING_INFO */
 
 /* The debug hooks structure.  */
-struct gcc_debug_hooks sdb_debug_hooks =
+const struct gcc_debug_hooks sdb_debug_hooks =
 {
   sdbout_init,			/* init */
   sdbout_finish,		/* finish */
diff -rup orig/egcc-CVS20011223/gcc/toplev.c egcc-CVS20011223/gcc/toplev.c
--- orig/egcc-CVS20011223/gcc/toplev.c	Mon Dec 17 16:30:35 2001
+++ egcc-CVS20011223/gcc/toplev.c	Sun Dec 23 19:14:17 2001
@@ -210,7 +210,7 @@ extern int target_flags;
 
 /* Debug hooks - dependent upon command line options.  */
 
-struct gcc_debug_hooks *debug_hooks = &do_nothing_debug_hooks;
+const struct gcc_debug_hooks *debug_hooks = &do_nothing_debug_hooks;
 
 /* Describes a dump file.  */
 
diff -rup orig/egcc-CVS20011223/gcc/vmsdbgout.c egcc-CVS20011223/gcc/vmsdbgout.c
--- orig/egcc-CVS20011223/gcc/vmsdbgout.c	Mon Dec 10 07:30:31 2001
+++ egcc-CVS20011223/gcc/vmsdbgout.c	Sun Dec 23 19:16:32 2001
@@ -173,7 +173,7 @@ static void vmsdbgout_abstract_function 
 
 /* The debug hooks structure.  */
 
-struct gcc_debug_hooks vmsdbg_debug_hooks
+const struct gcc_debug_hooks vmsdbg_debug_hooks
 = {vmsdbgout_init,
    vmsdbgout_finish,
    vmsdbgout_define,


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