diff options
-rw-r--r-- | gcc/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/cp-lang.c | 2 | ||||
-rw-r--r-- | gcc/langhooks.c | 29 | ||||
-rw-r--r-- | gcc/langhooks.h | 3 | ||||
-rw-r--r-- | gcc/toplev.c | 3 | ||||
-rw-r--r-- | gcc/toplev.h | 3 |
7 files changed, 48 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 44d633a..6393397 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2001-10-25 Zack Weinberg <zack@codesourcery.com> + + * langhooks.c (lang_hook_default_clear_binding_stack): New. + (lang_hook_default_get_alias_set): Move next to other alias + hooks. + * langhooks.h: Prototype lang_hook_default_clear_binding_stack. + (LANG_HOOKS_CLEAR_BINDING_STACK): New macro. + (LANG_HOOKS_INITIALIZER): Add it. + * toplev.h (struct lang_hooks): Add clear_binding_stack. + * toplev.c (compile_file): Call lang_hooks.clear_binding_stack + instead of a loop calling poplevel. + 2001-10-25 Nick Clifton <nickc@cambridge.redhat.com> * config/mips/isa3264.h (SUBTARGET_CPP_SIZE_SPEC): Replace @@ -37,7 +49,7 @@ Wed Oct 24 18:43:42 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * dwarf2out.c (file_info_cmp): Always return consistent results. 2001-10-24 Roger Sayle <roger@eyesopen.com> - + * stmt.c (expand_end_case): Index jumptables from zero for suitably small values of minval. diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a8f7c2f..5fbcc47 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2001-10-25 Zack Weinberg <zack@codesourcery.com> + + * cp-lang.c: Redefine LANG_HOOKS_CLEAR_BINDING_STACK to + pop_everything. + Tue Oct 23 14:00:20 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * cp-lang.c (cxx_get_alias_set): New function. @@ -108,7 +113,7 @@ Tue Oct 23 14:00:20 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> 2001-10-10 Richard Henderson <rth@redhat.com> - * parse.y (asm_operand): Allow named operands. + * parse.y (asm_operand): Allow named operands. * semantics.c (finish_asm_stmt): Tweek for changed location of the operand constrant. @@ -144,7 +149,7 @@ Tue Oct 23 14:00:20 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * class.c (build_vtable_entry_ref): Const-ify. * decl.c (predefined_identifier, - initialize_predefined_identifiers): Likewise. + initialize_predefined_identifiers): Likewise. * init.c (build_new_1): Likewise. * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): Likewise. diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c index ca9f88f..4ff47af 100644 --- a/gcc/cp/cp-lang.c +++ b/gcc/cp/cp-lang.c @@ -32,6 +32,8 @@ static HOST_WIDE_INT cxx_get_alias_set PARAMS ((tree)); #define LANG_HOOKS_INIT cxx_init #undef LANG_HOOKS_FINISH #define LANG_HOOKS_FINISH cxx_finish +#undef LANG_HOOKS_CLEAR_BINDING_STACK +#define LANG_HOOKS_CLEAR_BINDING_STACK pop_everything #undef LANG_HOOKS_INIT_OPTIONS #define LANG_HOOKS_INIT_OPTIONS cxx_init_options #undef LANG_HOOKS_DECODE_OPTION diff --git a/gcc/langhooks.c b/gcc/langhooks.c index b912e71..40a041f 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -36,16 +36,6 @@ lang_hook_default_do_nothing () { } -/* Provide a default routine for alias sets that always returns -1. This - is used by languages that don't need to do anything special. */ - -HOST_WIDE_INT -lang_hook_default_get_alias_set (t) - tree t ATTRIBUTE_UNUSED; -{ - return -1; -} - /* Do nothing; the default hook to decode an option. */ int @@ -56,6 +46,25 @@ lang_hook_default_decode_option (argc, argv) return 0; } +/* Provide a default routine to clear the binding stack. This is used + by languages that don't need to do anything special. */ +void +lang_hook_default_clear_binding_stack () +{ + while (! global_bindings_p ()) + poplevel (0, 0, 0); +} + +/* Provide a default routine for alias sets that always returns -1. This + is used by languages that don't need to do anything special. */ + +HOST_WIDE_INT +lang_hook_default_get_alias_set (t) + tree t ATTRIBUTE_UNUSED; +{ + return -1; +} + /* Provide a hook routine for alias sets that always returns 0. This is used by languages that haven't deal with alias sets yet. */ diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 69ff1d8..d844cdb 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -38,9 +38,11 @@ extern HOST_WIDE_INT hook_get_alias_set_0 PARAMS ((tree)); extern void lang_hook_default_do_nothing PARAMS ((void)); extern int lang_hook_default_decode_option PARAMS ((int, char **)); extern HOST_WIDE_INT lang_hook_default_get_alias_set PARAMS ((tree)); +extern void lang_hook_default_clear_binding_stack PARAMS ((void)); #define LANG_HOOKS_INIT lang_hook_default_do_nothing #define LANG_HOOKS_FINISH lang_hook_default_do_nothing +#define LANG_HOOKS_CLEAR_BINDING_STACK lang_hook_default_clear_binding_stack #define LANG_HOOKS_INIT_OPTIONS lang_hook_default_do_nothing #define LANG_HOOKS_DECODE_OPTION lang_hook_default_decode_option #define LANG_HOOKS_POST_OPTIONS lang_hook_default_do_nothing @@ -99,6 +101,7 @@ int tree_inlining_default_hook_anon_aggr_type_p PARAMS ((tree)); #define LANG_HOOKS_INITIALIZER { \ LANG_HOOKS_INIT, \ LANG_HOOKS_FINISH, \ + LANG_HOOKS_CLEAR_BINDING_STACK, \ LANG_HOOKS_INIT_OPTIONS, \ LANG_HOOKS_DECODE_OPTION, \ LANG_HOOKS_POST_OPTIONS, \ diff --git a/gcc/toplev.c b/gcc/toplev.c index 1320013..818da6f 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2334,8 +2334,7 @@ compile_file (name) /* In case there were missing block closers, get us back to the global binding level. */ - while (! global_bindings_p ()) - poplevel (0, 0, 0); + (*lang_hooks.clear_binding_stack) (); /* Compilation is now finished except for writing what's left of the symbol table output. */ diff --git a/gcc/toplev.h b/gcc/toplev.h index 93b30f4..8f21b03 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -149,6 +149,9 @@ struct lang_hooks /* Called last, as a finalizer. */ void (*finish) PARAMS ((void)); + /* Called immediately after parsing to clear the binding stack. */ + void (*clear_binding_stack) PARAMS ((void)); + /* Called to initialize options, before any calls to decode_option. */ void (*init_options) PARAMS ((void)); |