aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2008-03-11 16:44:25 +0000
committerPaolo Bonzini <bonzini@gcc.gnu.org>2008-03-11 16:44:25 +0000
commit30e257e5442d40427d6c0fd082251aeae0fe747a (patch)
treef5b891f3a3c958104c9cd25ecf61b8a80ab3caf8 /gcc
parent608766dc374a9c28bb52bd2d2031e5e0ec6e6727 (diff)
downloadgcc-30e257e5442d40427d6c0fd082251aeae0fe747a.zip
gcc-30e257e5442d40427d6c0fd082251aeae0fe747a.tar.gz
gcc-30e257e5442d40427d6c0fd082251aeae0fe747a.tar.bz2
langhooks-def.h (LANG_HOOKS_CLEAR_BINDING_STACK): Delete.
2008-03-11 Paolo Bonzini <bonzini@gnu.org> * langhooks-def.h (LANG_HOOKS_CLEAR_BINDING_STACK): Delete. * langhooks.h (struct lang_hooks): Delete clear_binding_stack member. * toplev.c (compile_file): Don't call it. fortran: 2008-03-11 Paolo Bonzini <bonzini@gnu.org> * f95-lang.c (LANG_HOOKS_CLEAR_BINDING_STACK): Delete. (gfc_be_parse_file): Call clear_binding_stack from here. (gfc_clear_binding_stack): Rename to clear_binding_stack. java: 2008-03-11 Paolo Bonzini <bonzini@gnu.org> * jcf-parse.c (java_parse_file): Assert binding levels are left in order. * lang.c (LANG_HOOKS_CLEAR_BINDING_STACK, java_clear_binding_stack): Delete. From-SVN: r133115
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/f95-lang.c8
-rw-r--r--gcc/java/ChangeLog7
-rw-r--r--gcc/java/jcf-parse.c2
-rw-r--r--gcc/java/lang.c12
-rw-r--r--gcc/langhooks-def.h2
-rw-r--r--gcc/langhooks.h3
-rw-r--r--gcc/toplev.c4
9 files changed, 25 insertions, 25 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a2e4e20..0c26540 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2008-03-11 Paolo Bonzini <bonzini@gnu.org>
+
+ * langhooks-def.h (LANG_HOOKS_CLEAR_BINDING_STACK): Delete.
+ * langhooks.h (struct lang_hooks): Delete clear_binding_stack member.
+ * toplev.c (compile_file): Don't call it.
+
2008-03-11 Uros Bizjak <ubizjak@gmail.com>
PR middle-end/35526
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index e660d9c..8139d52 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2008-03-11 Paolo Bonzini <bonzini@gnu.org>
+
+ * f95-lang.c (LANG_HOOKS_CLEAR_BINDING_STACK): Delete.
+ (gfc_be_parse_file): Call clear_binding_stack from here.
+ (gfc_clear_binding_stack): Rename to clear_binding_stack.
+
2008-03-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35474
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index 7a3e413..52c0a81 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -96,7 +96,7 @@ static bool gfc_mark_addressable (tree);
void do_function_end (void);
int global_bindings_p (void);
void insert_block (tree);
-static void gfc_clear_binding_stack (void);
+static void clear_binding_stack (void);
static void gfc_be_parse_file (int);
static alias_set_type gfc_get_alias_set (tree);
@@ -111,7 +111,6 @@ static alias_set_type gfc_get_alias_set (tree);
#undef LANG_HOOKS_MARK_ADDRESSABLE
#undef LANG_HOOKS_TYPE_FOR_MODE
#undef LANG_HOOKS_TYPE_FOR_SIZE
-#undef LANG_HOOKS_CLEAR_BINDING_STACK
#undef LANG_HOOKS_GET_ALIAS_SET
#undef LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE
#undef LANG_HOOKS_OMP_PREDETERMINED_SHARING
@@ -134,7 +133,6 @@ static alias_set_type gfc_get_alias_set (tree);
#define LANG_HOOKS_MARK_ADDRESSABLE gfc_mark_addressable
#define LANG_HOOKS_TYPE_FOR_MODE gfc_type_for_mode
#define LANG_HOOKS_TYPE_FOR_SIZE gfc_type_for_size
-#define LANG_HOOKS_CLEAR_BINDING_STACK gfc_clear_binding_stack
#define LANG_HOOKS_GET_ALIAS_SET gfc_get_alias_set
#define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE gfc_omp_privatize_by_reference
#define LANG_HOOKS_OMP_PREDETERMINED_SHARING gfc_omp_predetermined_sharing
@@ -268,6 +266,8 @@ gfc_be_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
gfc_get_errors (&warnings, &errors);
errorcount += errors;
warningcount += warnings;
+
+ clear_binding_stack ();
}
@@ -536,7 +536,7 @@ pushdecl_top_level (tree x)
/* Clear the binding stack. */
static void
-gfc_clear_binding_stack (void)
+clear_binding_stack (void)
{
while (!global_bindings_p ())
poplevel (0, 0, 0);
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index a27c1cb..f783e53 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,10 @@
+2008-03-11 Paolo Bonzini <bonzini@gnu.org>
+
+ * jcf-parse.c (java_parse_file): Assert binding levels are
+ left in order.
+ * lang.c (LANG_HOOKS_CLEAR_BINDING_STACK, java_clear_binding_stack):
+ Delete.
+
2008-03-02 Jakub Jelinek <jakub@redhat.com>
* jcf-dump.c (version): Update copyright notice dates.
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index 3350191..b96798e 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -1702,6 +1702,7 @@ java_emit_static_constructor (void)
cgraph_build_static_cdtor ('I', body, DEFAULT_INIT_PRIORITY);
}
+
void
java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
{
@@ -1952,6 +1953,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
finish:
/* Arrange for any necessary initialization to happen. */
java_emit_static_constructor ();
+ gcc_assert (global_bindings_p ());
/* Only finalize the compilation unit after we've told cgraph which
functions have their addresses stored. */
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index 76b024c..fa98114 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -62,7 +62,6 @@ static bool java_dump_tree (void *, tree);
static void dump_compound_expr (dump_info_p, tree);
static bool java_decl_ok_for_sibcall (const_tree);
static tree java_get_callee_fndecl (const_tree);
-static void java_clear_binding_stack (void);
static enum classify_record java_classify_record (tree type);
@@ -197,9 +196,6 @@ struct language_function GTY(())
#undef LANG_HOOKS_GET_CALLEE_FNDECL
#define LANG_HOOKS_GET_CALLEE_FNDECL java_get_callee_fndecl
-#undef LANG_HOOKS_CLEAR_BINDING_STACK
-#define LANG_HOOKS_CLEAR_BINDING_STACK java_clear_binding_stack
-
#undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME java_mangle_decl
@@ -949,14 +945,6 @@ java_get_callee_fndecl (const_tree call_expr)
}
-/* Clear the binding stack. */
-static void
-java_clear_binding_stack (void)
-{
- while (!global_bindings_p ())
- poplevel (0, 0, 0);
-}
-
static enum classify_record
java_classify_record (tree type)
{
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index 21e1744..9f2cc71 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -85,7 +85,6 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *,
#define LANG_HOOKS_INIT hook_bool_void_false
#define LANG_HOOKS_FINISH lhd_do_nothing
#define LANG_HOOKS_PARSE_FILE lhd_do_nothing_i
-#define LANG_HOOKS_CLEAR_BINDING_STACK lhd_do_nothing
#define LANG_HOOKS_INIT_OPTIONS hook_uint_uint_constcharptrptr_0
#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS lhd_initialize_diagnostics
#define LANG_HOOKS_HANDLE_OPTION hook_int_size_t_constcharptr_int_0
@@ -250,7 +249,6 @@ extern tree lhd_make_node (enum tree_code);
LANG_HOOKS_INIT, \
LANG_HOOKS_FINISH, \
LANG_HOOKS_PARSE_FILE, \
- LANG_HOOKS_CLEAR_BINDING_STACK, \
LANG_HOOKS_GET_ALIAS_SET, \
LANG_HOOKS_EXPAND_EXPR, \
LANG_HOOKS_EXPAND_DECL, \
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index bbbcc68..9da60f1 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -294,9 +294,6 @@ struct lang_hooks
parsers to dump debugging information during parsing. */
void (*parse_file) (int);
- /* Called immediately after parsing to clear the binding stack. */
- void (*clear_binding_stack) (void);
-
/* Called to obtain the alias set to be used for an expression or type.
Returns -1 if the language does nothing special for it. */
alias_set_type (*get_alias_set) (tree);
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 58c19c5..12777aa 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -958,10 +958,6 @@ compile_file (void)
rest_of_compilation for each function). */
lang_hooks.parse_file (set_yydebug);
- /* In case there were missing block closers,
- get us back to the global binding level. */
- lang_hooks.clear_binding_stack ();
-
/* Compilation is now finished except for writing
what's left of the symbol table output. */
timevar_pop (TV_PARSE);