c-common.c (back_end_hook): New variable.
authorMark Mitchell <mark@codesourcery.com>
Wed, 18 Oct 2000 05:45:37 +0000 (05:45 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Wed, 18 Oct 2000 05:45:37 +0000 (05:45 +0000)
* c-common.c (back_end_hook): New variable.
* c-common.h (back_end_hook): Declare it.
* c-lang.c (finish_file): Use it.

* emit-rtl.c (init_emit_once): Initialize the const_int_htab
earlier.

* cp-tree.h (back_end_hook): Remove declaration.
* decl2.c (back_end_hook): Remove definition.

* dump.c (dequeue_and_dump): Dump TREE_USED.

From-SVN: r36928

gcc/ChangeLog
gcc/c-common.c
gcc/c-common.h
gcc/c-lang.c
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl2.c
gcc/cp/dump.c
gcc/emit-rtl.c

index 24f71bef970cc12beee102906003bbd9a2f798a7..fc1f8db160c410adbbae1b6a37c105ba87135d7c 100644 (file)
@@ -1,3 +1,12 @@
+2000-10-17  Mark Mitchell  <mark@codesourcery.com>
+
+       * c-common.c (back_end_hook): New variable.
+       * c-common.h (back_end_hook): Declare it.
+       * c-lang.c (finish_file): Use it.
+
+       * emit-rtl.c (init_emit_once): Initialize the const_int_htab
+       earlier.
+       
 2000-10-18  Jan Hubikca  <jh@suse.cz>
 
         * i386.c (ix86_comparison_operator, put_condition_code,
index 2fb63fde5a04d76ca5010afa5b27e986273f1776..72118c8f8d879dfb0b77535c6cbc897904b725cf 100644 (file)
@@ -158,6 +158,10 @@ int (*lang_statement_code_p)           PARAMS ((enum tree_code));
    any action required right before expand_function_end is called.  */
 void (*lang_expand_function_end)       PARAMS ((void));
 
+/* If this variable is defined to a non-NULL value, it will be called
+   after the file has been completely parsed.  */
+void (*back_end_hook) PARAMS ((tree));
+
 /* Nonzero means the expression being parsed will never be evaluated.
    This is a count, since unevaluated expressions can nest.  */
 int skip_evaluation;
index 2280b93a93e80967f8171b48de202d4231b18ec8..a4bd09e9274b4cffbef12f2a3433dc2707567a7e 100644 (file)
@@ -697,6 +697,12 @@ extern tree c_add_case_label                    PARAMS ((splay_tree,
 
 extern tree build_function_call                        PARAMS ((tree, tree));
 
+/* If this variable is defined to a non-NULL value, it will be called
+   after the file has been completely parsed.  The argument will be
+   the GLOBAL_NAMESPACE in C++, or the list of top-level declarations
+   in C.  */
+extern void (*back_end_hook) PARAMS ((tree));
+
 #ifdef RTX_CODE
 
 extern struct rtx_def *c_expand_expr            PARAMS ((tree, rtx,
@@ -720,3 +726,5 @@ struct c_fileinfo *get_fileinfo                     PARAMS ((const char *));
 extern void dump_time_statistics               PARAMS ((void));
 
 #endif
+
+
index 21b8f0f273b6b501e45943fbe1c29874a7af02fb..ab36a2ea37ef548e8cdaaa92baf4579804a00519 100644 (file)
@@ -242,6 +242,9 @@ finish_file ()
       assemble_destructor (IDENTIFIER_POINTER (fnname));
     }
 #endif
+  
+  if (back_end_hook)
+    (*back_end_hook) (getdecls ());
 }
 
 /* Called during diagnostic message formatting process to print a
index 4246ac604a12511d97710755f98f96dcfd95d09f..d4f8e47f4dce050bde1695ed720222c95e8be25b 100644 (file)
@@ -1,3 +1,10 @@
+2000-10-17  Mark Mitchell  <mark@codesourcery.com>
+
+       * cp-tree.h (back_end_hook): Remove declaration.
+       * decl2.c (back_end_hook): Remove definition.
+
+       * dump.c (dequeue_and_dump): Dump TREE_USED.
+
 Tue Oct 17 20:19:06 2000  Brad Lucier <lucier@math.purdue.edu>
 
        * spew.c (snarf_defarg): Cast 2nd arg to obstack_blank to (int).
index 1a6c51848170628e0da2738c3e87b5a0ebf49a8c..689c859599e2849e2cae2e48547e130244ba3800 100644 (file)
@@ -1170,12 +1170,6 @@ extern int flag_access_control;
 
 extern int flag_check_new;
 
-/* If this variable is defined to a non-NULL value, it will be called
-   after the file has been completely parsed.  The argument will be
-   the GLOBAL_NAMESPACE.  */
-
-extern void (*back_end_hook) PARAMS ((tree));
-
 \f
 /* C++ language-specific tree codes.  */
 #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
index 4f6b57e15d78b77dbc2d85a02d9b002f814fae26..fc319b7d7ae727f94dc3dafb0940bd05b57014b1 100644 (file)
@@ -490,11 +490,6 @@ int flag_permissive;
 
 int flag_enforce_eh_specs = 1;
 
-/* If this variable is defined to a non-NULL value, it will be called
-   after the file has been completely parsed.  */
-
-void (*back_end_hook) PARAMS ((tree));
-
 /* The variant of the C language being processed.  */
 
 c_language_kind c_language = clk_cplusplus;
index 9b711062070639eb66b2f5298c9269719b44b5bc..83c7db060587f02ddc91a6a4e5b152f2c371ba7d 100644 (file)
@@ -555,6 +555,9 @@ dequeue_and_dump (di)
          if (DECL_FIELD_OFFSET (t))
            dump_child ("bpos", bit_position (t));
        }
+      else if (TREE_CODE (t) == VAR_DECL 
+              || TREE_CODE (t) == PARM_DECL)
+       dump_int (di, "used", TREE_USED (t));
       break;
 
     case FUNCTION_DECL:
index 66b1f7e93a925d0e79124cc000ffedb9cbddb069..3929e8820cfd0174b57fd04da4d2a0a25bbf3f5b 100644 (file)
@@ -4008,6 +4008,12 @@ init_emit_once (line_numbers)
   enum machine_mode mode;
   enum machine_mode double_mode;
 
+  /* Initialize the CONST_INT hash table.  */
+  const_int_htab = htab_create (37, const_int_htab_hash, 
+                               const_int_htab_eq, NULL);
+  ggc_add_root (&const_int_htab, 1, sizeof (const_int_htab), 
+               rtx_htab_mark);
+
   no_line_numbers = ! line_numbers;
 
   /* Compute the word and byte modes.  */
@@ -4191,12 +4197,6 @@ init_emit_once (line_numbers)
   ggc_add_rtx_root (&static_chain_rtx, 1);
   ggc_add_rtx_root (&static_chain_incoming_rtx, 1);
   ggc_add_rtx_root (&return_address_pointer_rtx, 1);
-
-  /* Initialize the CONST_INT hash table.  */
-  const_int_htab = htab_create (37, const_int_htab_hash, 
-                               const_int_htab_eq, NULL);
-  ggc_add_root (&const_int_htab, 1, sizeof (const_int_htab), 
-               rtx_htab_mark);
 }
 \f
 /* Query and clear/ restore no_line_numbers.  This is used by the