diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-14 22:00:20 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-14 22:00:20 +0000 |
commit | 9bd976371006517f003ad95d2a60142a1cae3e0d (patch) | |
tree | 50cf96bbdb5a327d25f89c6505861b5c2d979351 /gcc/cppinit.c | |
parent | 3e02ce3031888cf1bff6c5ee5267510f5874a01a (diff) | |
download | gcc-9bd976371006517f003ad95d2a60142a1cae3e0d.tar.gz |
* c-parse.in (finish_parse): Add comment about cpp_destroy.
* cp/lex.c (finish_parse): Similarly.
* cppinit.c (cpp_cleanup): Rename cpp_destroy for clarity.
Return the number of errors encountered.
* cpplib.h (cpp_cleanup): Rename cpp_destroy, return int.
* cppmain.c (main): Don't call cpp_destroy.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39020 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r-- | gcc/cppinit.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c index c3347c94d71..9250f0807ed 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -557,12 +557,13 @@ cpp_create_reader (lang) return pfile; } -/* Free resources used by PFILE. - This is the cpp_reader 'finalizer' or 'destructor' (in C++ terminology). */ -void -cpp_cleanup (pfile) +/* Free resources used by PFILE. Accessing PFILE after this function + returns leads to undefined behaviour. */ +int +cpp_destroy (pfile) cpp_reader *pfile; { + int result; struct file_name_list *dir, *dirn; cpp_context *context, *contextn; @@ -600,6 +601,11 @@ cpp_cleanup (pfile) contextn = context->next; free (context); } + + result = pfile->errors; + free (pfile); + + return result; } |