aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.h
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-09-26 17:52:50 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-09-26 17:52:50 +0000
commitb8af0ca5c72a8663b3ea7b0d706cb7055d827aed (patch)
treec6066a336fb26cdd94d5e883ad2dbefc8c99c02d /gcc/cpphash.h
parent9c383523a3f308e683dea3fb80e5774bfb2a040f (diff)
downloadgcc-b8af0ca5c72a8663b3ea7b0d706cb7055d827aed.zip
gcc-b8af0ca5c72a8663b3ea7b0d706cb7055d827aed.tar.gz
gcc-b8af0ca5c72a8663b3ea7b0d706cb7055d827aed.tar.bz2
cpphash.h (struct _cpp_buff, [...]): New.
* cpphash.h (struct _cpp_buff, _cpp_get_buff, _cpp_release_buff, _cpp_extend_buff, _cpp_free_buff): New. (struct cpp_reader): New member free_buffs. * cppinit.c (cpp_destroy): Free buffers. * cpplex.c (new_buff, _cpp_release_buff, _cpp_get_buff, _cpp_extend_buff, _cpp_free_buff): New. * cpplib.h (struct cpp_options): Remove unused member. * cppmacro.c (collect_args): New. Combines the old parse_arg and parse_args. Use _cpp_buff for memory allocation. (funlike_invocation_p, replace_args): Update. From-SVN: r45827
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r--gcc/cpphash.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index 001ac60..ee5b03e 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -72,6 +72,21 @@ struct cpp_pool
unsigned int locks;
};
+/* A generic memory buffer. */
+
+typedef struct _cpp_buff _cpp_buff;
+struct _cpp_buff
+{
+ struct _cpp_buff *next;
+ char *base, *cur, *limit;
+};
+
+extern _cpp_buff *_cpp_get_buff PARAMS ((cpp_reader *, unsigned int));
+extern void _cpp_release_buff PARAMS ((cpp_reader *, _cpp_buff *));
+extern _cpp_buff *_cpp_extend_buff PARAMS ((cpp_reader *, _cpp_buff *,
+ unsigned int));
+extern void _cpp_free_buff PARAMS ((_cpp_buff *));
+
/* List of directories to look for include files in. */
struct search_path
{
@@ -254,6 +269,9 @@ struct cpp_reader
cpp_pool macro_pool; /* For macro definitions. Permanent. */
cpp_pool argument_pool; /* For macro arguments. Temporary. */
+ /* Memory buffers. */
+ _cpp_buff *free_buffs;
+
/* Context stack. */
struct cpp_context base_context;
struct cpp_context *context;