diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2001-01-14 22:00:20 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2001-01-14 22:00:20 +0000 |
commit | 400023a387aff2324ad72d965bfbf1a3afd2bfea (patch) | |
tree | 50cf96bbdb5a327d25f89c6505861b5c2d979351 /gcc/cppinit.c | |
parent | 984ad2c6332bdf6fb4ce651345b20f1473aff23a (diff) | |
download | gcc-400023a387aff2324ad72d965bfbf1a3afd2bfea.zip gcc-400023a387aff2324ad72d965bfbf1a3afd2bfea.tar.gz gcc-400023a387aff2324ad72d965bfbf1a3afd2bfea.tar.bz2 |
c-parse.in (finish_parse): Add comment about cpp_destroy.
* 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.
From-SVN: r39020
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 c3347c9..9250f08 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; } |