summaryrefslogtreecommitdiff
path: root/gcc/langhooks.c
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-25 17:57:03 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-25 17:57:03 +0000
commitdf2114d0e2c333ddb9559cd85ac6e5a5b0a98874 (patch)
tree12b2533fede08e5ce838d046b4e64bf512682986 /gcc/langhooks.c
parent545221984dd7e018f4fc3e579b0b571b21f91622 (diff)
downloadgcc-df2114d0e2c333ddb9559cd85ac6e5a5b0a98874.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46492 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/langhooks.c')
-rw-r--r--gcc/langhooks.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index b912e711bfc..40a041fcece 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. */