summaryrefslogtreecommitdiff
path: root/libcpp/init.c
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-05 12:35:36 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-05 12:35:36 +0000
commit956c6108f4cd69f7a8188d1ae822f05ddbde8604 (patch)
tree4d3817d3b652d403b257af245aaef0fa4682d210 /libcpp/init.c
parent146ac79f902b964ba1ea339ea57f3a74f789355c (diff)
downloadgcc-956c6108f4cd69f7a8188d1ae822f05ddbde8604.tar.gz
2008-10-05 Matthew Gingell <gingell@adacore.com>
Arnaud Charlet <charlet@adacore.com> * include/cpplib.h (cpp_comments, cpp_comment_table): New structs. (cpp_get_comments): New function. * internal.h (struct cpp_reader): Add comments field. * init.c (cpp_destroy): Free comments. * lex.c (store_comment, cpp_get_comments): New functions. (comments): New struct. (save_comment): Store comments in comments struct. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140883 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/init.c')
-rw-r--r--libcpp/init.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libcpp/init.c b/libcpp/init.c
index 0db167c133c..cc7a09ed8c2 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -245,6 +245,7 @@ cpp_destroy (cpp_reader *pfile)
{
cpp_context *context, *contextn;
tokenrun *run, *runn;
+ int i;
free (pfile->op_stack);
@@ -287,6 +288,14 @@ cpp_destroy (cpp_reader *pfile)
free (context);
}
+ if (pfile->comments.entries)
+ {
+ for (i = 0; i < pfile->comments.count; i++)
+ free (pfile->comments.entries[i].comment);
+
+ free (pfile->comments.entries);
+ }
+
free (pfile);
}