aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-08-17 23:07:54 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-08-17 23:07:54 +0000
commit1b12a13e40038d786ee0e3e757fe03905ec5eecb (patch)
tree87b552c0f355829468309897fcd610f3e14ddc58 /gcc
parent47359a8efab153e0ed904d27f2672ba8271693b1 (diff)
downloadgcc-1b12a13e40038d786ee0e3e757fe03905ec5eecb.zip
gcc-1b12a13e40038d786ee0e3e757fe03905ec5eecb.tar.gz
gcc-1b12a13e40038d786ee0e3e757fe03905ec5eecb.tar.bz2
cp-tree.h (back_end_hook): New variable.
* cp-tree.h (back_end_hook): New variable. * decl2.c (back_end_hook): Define it. (finish_file): If it's non-NULL, call it. From-SVN: r28741
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/cp-tree.h6
-rw-r--r--gcc/cp/decl2.c10
3 files changed, 20 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ee595ab..86b452b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
1999-08-17 Mark Mitchell <mark@codesourcery.com>
+ * cp-tree.h (back_end_hook): New variable.
+ * decl2.c (back_end_hook): Define it.
+ (finish_file): If it's non-NULL, call it.
+
* decl.c (add_decl_to_level): New function.
(push_local_binding): Use it.
(find_binding): Fix typo in comment.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 91ce272..6c585d4 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -613,6 +613,12 @@ extern int flag_permissive;
extern int flag_access_control;
+/* 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) PROTO((tree));
+
/* C++ language-specific tree codes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 7e0e23b..7fd9be0 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -476,6 +476,11 @@ int flag_vtable_gc;
int flag_permissive;
+/* 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) PROTO((tree));
+
/* Table of language-dependent -f options.
STRING is the option name. VARIABLE is the address of the variable.
ON_VALUE is the value to store in VARIABLE
@@ -3675,6 +3680,11 @@ finish_file ()
if (flag_dump_translation_unit)
dump_node_to_file (global_namespace, flag_dump_translation_unit);
+ /* If there's some tool that wants to examine the entire translation
+ unit, let it do so now. */
+ if (back_end_hook)
+ (*back_end_hook) (global_namespace);
+
this_time = get_run_time ();
parse_time -= this_time - start_time;
varconst_time += this_time - start_time;