Commit 7cb4ff28 by Zack Weinberg Committed by Zack Weinberg

toplev.c (compile_file): Ignore return value from yyparse.

	* toplev.c (compile_file): Ignore return value from yyparse.
	Always pop any nested binding levels after yyparse returns.

From-SVN: r46223
parent b14127e6
2001-10-11 Zack Weinberg <zack@codesourcery.com>
* toplev.c (compile_file): Ignore return value from yyparse.
Always pop any nested binding levels after yyparse returns.
2001-10-11 Richard Henderson <rth@redhat.com> 2001-10-11 Richard Henderson <rth@redhat.com>
* doc/c-tree.texi (Expression trees): Add VTABLE_REF. * doc/c-tree.texi (Expression trees): Add VTABLE_REF.
......
...@@ -2118,8 +2118,9 @@ pop_srcloc () ...@@ -2118,8 +2118,9 @@ pop_srcloc ()
lineno = input_file_stack->line; lineno = input_file_stack->line;
} }
/* Compile an entire file of output from cpp, named NAME. /* Compile an entire translation unit, whose primary source file is
Write a file of assembly output and various debugging dumps. */ named NAME. Write a file of assembly output and various debugging
dumps. */
static void static void
compile_file (name) compile_file (name)
...@@ -2140,7 +2141,7 @@ compile_file (name) ...@@ -2140,7 +2141,7 @@ compile_file (name)
init_timevar (); init_timevar ();
timevar_start (TV_TOTAL); timevar_start (TV_TOTAL);
/* Open assembler code output file. Do this even if -fsyntax-only is on, /* Open assembly code output file. Do this even if -fsyntax-only is on,
because then the driver will have provided the name of a temporary because then the driver will have provided the name of a temporary
file or bit bucket for us. */ file or bit bucket for us. */
...@@ -2324,17 +2325,12 @@ compile_file (name) ...@@ -2324,17 +2325,12 @@ compile_file (name)
/* Call the parser, which parses the entire file /* Call the parser, which parses the entire file
(calling rest_of_compilation for each function). */ (calling rest_of_compilation for each function). */
yyparse ();
if (yyparse () != 0) /* In case there were missing block closers,
{ get us back to the global binding level. */
if (errorcount == 0) while (! global_bindings_p ())
fnotice (stderr, "Errors detected in input file (your bison.simple is out of date)\n"); poplevel (0, 0, 0);
/* In case there were missing closebraces,
get us back to the global binding level. */
while (! global_bindings_p ())
poplevel (0, 0, 0);
}
/* Compilation is now finished except for writing /* Compilation is now finished except for writing
what's left of the symbol table output. */ what's left of the symbol table output. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment