summaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-11-18 11:04:53 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-11-18 11:04:53 +0000
commit22703ccc3fb15defc154d8a4bd665ddf76efbd08 (patch)
tree2092e937365d4aa4305ac9206c9b38c72a6f6d56 /gcc/c-common.c
parent6ad8427bba9b3fc18363b5667b43e0afd9421bc2 (diff)
downloadgcc-22703ccc3fb15defc154d8a4bd665ddf76efbd08.tar.gz
Makefile.in (c-parse.o, c-common.o): Update dependencies.
* Makefile.in (c-parse.o, c-common.o): Update dependencies. * c-common.c: Include diagnostic.h. (c_common_finish): New. * c-common.h (c_common_finish): New. * c-lang.c (LANG_HOOKS_FINISH): Override. * c-parse.in: Don't include diagnostic.h. (finish_parse): Remove. * langhooks.h: Update comments. * toplev.c (lang_dependent_init): New prototype. (finalize): New. (compile_file): Split cleanup code out to finalize. (lang_dependent_init): Stop if lang_hooks.init fails. (toplev_main): Update. * tree.h (finish_parse): Remove. ada: * misc.c (gnat_decode_option, gnat_init_options): Make definitions static too. (gnat_init): Don't return NULL. (finish_parse): Remove. cp: * lex.c (cxx_finish): Call c_common_finish. (finish_parse): Remove. f: * com.c (finish_parse): Remove. (ffe_finish): Move body of finish_parse. java: * lang.c (finish_parse): Rename to java_finish. (LANG_HOOKS_FINISH, java_finish): New. objc: * objc-act.c (LANG_HOOKS_FINISH): Override. From-SVN: r47141
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 6b6b36b720f..dde1af3b892 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -30,6 +30,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ggc.h"
#include "expr.h"
#include "c-common.h"
+#include "diagnostic.h"
#include "tm_p.h"
#include "obstack.h"
#include "c-lex.h"
@@ -3889,6 +3890,17 @@ c_common_lang_init (filename)
return filename;
}
+/* Common finish hook for the C, ObjC and C++ front ends. */
+void
+c_common_finish ()
+{
+ cpp_finish (parse_in);
+
+ /* For performance, avoid tearing down cpplib's internal structures.
+ Call cpp_errors () instead of cpp_destroy (). */
+ errorcount += cpp_errors (parse_in);
+}
+
static void
c_init_attributes ()
{