aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.h
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-03-08 20:37:23 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-03-08 20:37:23 +0000
commit38b24ee220dc8e9051d8a60a1ad52f4ff5139f80 (patch)
tree1653b79c8f978db12857348c7022fa5ac999b2f5 /gcc/cpplib.h
parentdd05e4fae90b9f885f20217bd5b18ed13030314c (diff)
downloadgcc-38b24ee220dc8e9051d8a60a1ad52f4ff5139f80.zip
gcc-38b24ee220dc8e9051d8a60a1ad52f4ff5139f80.tar.gz
gcc-38b24ee220dc8e9051d8a60a1ad52f4ff5139f80.tar.bz2
cpplib.h (parse_underflow_t, [...]): Delete.
* cpplib.h (parse_underflow_t, CPP_NULL_BUFFER): Delete. (struct cpp_buffer): Remove fname and underflow fields. (struct cpp_reader): Remove get_token field. (struct include_hash): Rename to struct ihash. Add typedef to IHASH. (struct if_stack): Remove fname field. (IF_STACK_FRAME): Rename to IF_STACK. * cpperror.c (print_containing_files): Trust that there are no macro buffers below the top file buffer. * cppfiles.c: Replace all references to 'struct include_hash' with 'IHASH'. Rename initialize_input_buffer to init_input_buffer. Don't set or reference cpp_buffer->fname, use buffer->ihash->name instead. * cpphash.c (special_symbol): Use cpp_file_buffer. Use NULL not CPP_NULL_BUFFER. * cppinit.c: Use NULL not CPP_NULL_BUFFER, IF_STACK not IF_STACK_FRAME, IHASH not struct include_hash. * cpplib.c: Rename eval_if_expression to eval_if_expr. Remove null_underflow. Use IF_STACK not IF_STACK_FRAME, IHASH not struct include_hash, NULL not CPP_NULL_BUFFER. Remove all references to cpp_buffer->fname (delete entirely, or use ->ihash->name instead) and IF_STACK->fname. (cpp_push_buffer): Don't set new->underflow. (do_include): Use cpp_file_buffer. * cpphash.c (collect_formal_parameters): Remove duplicate increment of argslen. Pedwarn in C99 mode if __VA_ARGS__ is used as a macro argument name. Don't append "..." to namebuf for varargs macros. After we're done scanning, go through namebuf and make it NUL separated, not comma separated. (_cpp_compare_defs): Remove register tag from variables. Expect defn->argnames to be NUL separated. (_cpp_dump_definition): Expect defn->argnames to be NUL separated and in forward order. * cpphash.h: Update documentation of argnames field. From-SVN: r32430
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r--gcc/cpplib.h40
1 files changed, 15 insertions, 25 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 435f9ddc..a054480 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -61,7 +61,6 @@ enum cpp_token
CPP_POP /* We're about to pop the buffer stack. */
};
-typedef enum cpp_token (*parse_underflow_t) PARAMS((cpp_reader *));
typedef int (*parse_cleanup_t) PARAMS((cpp_buffer *, cpp_reader *));
extern int cpp_handle_options PARAMS ((cpp_reader *, int, char **));
@@ -82,8 +81,6 @@ struct cpp_buffer
struct cpp_buffer *prev;
- /* Real filename. (Alias to ->ihash->fname, obsolete). */
- const char *fname;
/* Filename specified with #line command. */
const char *nominal_fname;
/* Last filename specified with #line command. */
@@ -93,12 +90,11 @@ struct cpp_buffer
/* Pointer into the include hash table. Used for include_next and
to record control macros. */
- struct include_hash *ihash;
+ struct ihash *ihash;
long lineno; /* Line number at CPP_LINE_BASE. */
long colno; /* Column number at CPP_LINE_BASE. */
long mark; /* Saved position for lengthy backtrack. */
- parse_underflow_t underflow;
parse_cleanup_t cleanup;
void *data;
@@ -146,7 +142,6 @@ struct file_name_map_list;
struct cpp_reader
{
- parse_underflow_t get_token;
cpp_buffer *buffer;
cpp_options *opts;
@@ -175,7 +170,7 @@ struct cpp_reader
/* Hash table of other included files. See cppfiles.c */
#define ALL_INCLUDE_HASHSIZE 71
- struct include_hash *all_include_files[ALL_INCLUDE_HASHSIZE];
+ struct ihash *all_include_files[ALL_INCLUDE_HASHSIZE];
/* Chain of `actual directory' file_name_list entries,
for "" inclusion. */
@@ -284,8 +279,6 @@ struct cpp_reader
#define CPP_OPTIONS(PFILE) ((PFILE)->opts)
#define CPP_BUFFER(PFILE) ((PFILE)->buffer)
#define CPP_PREV_BUFFER(BUFFER) ((BUFFER)->prev)
-/* The bottom of the buffer stack. */
-#define CPP_NULL_BUFFER(PFILE) NULL
/* The `pending' structure accumulates all the options that are not
actually processed until we hit cpp_start_read. It consists of
@@ -528,12 +521,12 @@ struct file_name_list
/* This structure is used for the table of all includes. It is
indexed by the `short name' (the name as it appeared in the
#include statement) which is stored in *nshort. */
-struct include_hash
+struct ihash
{
- struct include_hash *next;
+ struct ihash *next;
/* Next file with the same short name but a
different (partial) pathname). */
- struct include_hash *next_this_file;
+ struct ihash *next_this_file;
/* Location of the file in the include search path.
Used for include_next */
@@ -545,6 +538,7 @@ struct include_hash
char *buf, *limit; /* for file content cache,
not yet implemented */
};
+typedef struct ihash IHASH;
/* Name under which this program was invoked. */
@@ -623,17 +617,15 @@ extern unsigned char _cpp_IStable[256];
/* Stack of conditionals currently in progress
(including both successful and failing conditionals). */
-struct if_stack {
- struct if_stack *next; /* for chaining to the next stack frame */
- const char *fname; /* copied from input when frame is made */
- int lineno; /* similarly */
- int if_succeeded; /* true if a leg of this if-group
- has been passed through rescan */
- U_CHAR *control_macro; /* For #ifndef at start of file,
- this is the macro name tested. */
+struct if_stack
+{
+ struct if_stack *next;
+ int lineno; /* line number where condition started */
+ int if_succeeded; /* truth of last condition in this group */
+ const U_CHAR *control_macro; /* macro name for #ifndef around entire file */
enum node_type type; /* type of last directive seen in this group */
};
-typedef struct if_stack IF_STACK_FRAME;
+typedef struct if_stack IF_STACK;
extern void cpp_buf_line_and_col PARAMS((cpp_buffer *, long *, long *));
extern cpp_buffer *cpp_file_buffer PARAMS((cpp_reader *));
@@ -700,10 +692,8 @@ extern void _cpp_simplify_pathname PARAMS ((char *));
extern void _cpp_merge_include_chains PARAMS ((struct cpp_options *));
extern int _cpp_find_include_file PARAMS ((cpp_reader *, const char *,
struct file_name_list *,
- struct include_hash **,
- int *));
-extern int _cpp_read_include_file PARAMS ((cpp_reader *, int,
- struct include_hash *));
+ IHASH **, int *));
+extern int _cpp_read_include_file PARAMS ((cpp_reader *, int, IHASH *));
/* In cppexp.c */
extern HOST_WIDEST_INT _cpp_parse_expr PARAMS ((cpp_reader *));