* 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.
cp:
* cp-lang.c: Redefine LANG_HOOKS_CLEAR_BINDING_STACK to
pop_everything.
From-SVN: r46492
+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
* 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.
+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.
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.
* 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.
#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
{
}
-/* 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
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. */
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
#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, \
/* 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. */
/* 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));