fix intermodule mode
Zack Weinberg
zack@codesourcery.com
Thu Aug 7 03:12:00 GMT 2003
The big patch that makes this stuff work properly is taking longer
than I would like, so here is a small patch that just makes it
functional again.
Bootstrapped i686-linux, C only, --enable-intermodule.
zw
* c-decl.c (builtin_decls): Replace with first_builtin_decl
and last_builtin_decl.
(c_init_decl_processing): Initialize both.
(c_reset_state): Iterate from first_builtin_decl to
last_builtin_decl inclusive to reintroduce builtins.
===================================================================
Index: c-decl.c
--- c-decl.c 5 Aug 2003 14:11:41 -0000 1.428
+++ c-decl.c 7 Aug 2003 03:09:15 -0000
@@ -130,9 +130,10 @@ static GTY(()) tree c_scope_stmt_stack;
some other global meaning for that identifier. */
static GTY(()) tree truly_local_externals;
-/* A list of the builtin file-scope DECLs. */
+/* All the builtins; this is a subset of the entries of global_scope. */
-static GTY(()) tree builtin_decls;
+static GTY(()) tree first_builtin_decl;
+static GTY(()) tree last_builtin_decl;
/* A DECL for the current file-scope context. */
@@ -2288,7 +2289,8 @@ c_init_decl_processing (void)
make_fname_decl = c_make_fname_decl;
start_fname_decls ();
- builtin_decls = global_scope->names;
+ first_builtin_decl = global_scope->names;
+ last_builtin_decl = global_scope->names_last;
}
/* Create the VAR_DECL for __FUNCTION__ etc. ID is the name to give the
@@ -6869,8 +6871,10 @@ c_reset_state (void)
current_file_decl = build_decl (TRANSLATION_UNIT_DECL, NULL, NULL);
TREE_CHAIN (current_file_decl) = file_scope_decl;
- /* Reintroduce the global declarations. */
- for (link = builtin_decls; link; link = TREE_CHAIN (link))
+ /* Reintroduce the builtin declarations. */
+ for (link = first_builtin_decl;
+ link != TREE_CHAIN (last_builtin_decl);
+ link = TREE_CHAIN (link))
pushdecl (copy_node (link));
}
More information about the Gcc-patches
mailing list