summaryrefslogtreecommitdiff
path: root/gcc/fix-header.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-28 21:13:35 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-28 21:13:35 +0000
commit9751c00e176f73ca4a921e9b9b15486d875da475 (patch)
treee48c58ce615d53fe8e02183447bad8c0843a2462 /gcc/fix-header.c
parentf23abae55e71b922f87e25034768ad92d2cefcff (diff)
downloadgcc-9751c00e176f73ca4a921e9b9b15486d875da475.tar.gz
* c-lex.h (parse_in): Change parse_in to a cpp_reader *.
* c-decl.c (c_decode_option): Update to match. * c-lex.c (init_c_lex, yyparse): Update to match. * c-lang.c (lang_init_options): Use cpp_create_reader. * cppinit.c (cpp_init): Rename initialize. (cpp_reader_init): Rename cpp_create_reader. Create the reader. Initialize cpplib if appropriate. * cpplib.h (cpp_create_reader) New prototype. (cpp_init, cpp_reader_init): Delete prototypes. * cppmain.c (general_init, setup_callbacks): New functions. (main): Use them. * fix-header.c (scan_in): Change type to cpp_reader *. (read_scan_file): Update for new cpplib interface and scan_in type. * cp/decl.c (parse_in): Change to cpp_reader *. (lang_decode_option): Update. * cp/lex.c (lang_init_options): Use new cpplib interface. (init_cp_pragma, finish_parse, handle_pragma_implementation): Update. * cp/spew.c (read_token): Update. * objc/objc-act.c (lang_init_options): Update new cpplib interface. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37826 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fix-header.c')
-rw-r--r--gcc/fix-header.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/gcc/fix-header.c b/gcc/fix-header.c
index 5fb2c6a2916..7e030d81f27 100644
--- a/gcc/fix-header.c
+++ b/gcc/fix-header.c
@@ -612,36 +612,35 @@ read_scan_file (in_fname, argc, argv)
int argc;
char **argv;
{
- cpp_reader scan_in;
+ cpp_reader* scan_in;
struct fn_decl *fn;
int i;
register struct symbol_list *cur_symbols;
obstack_init (&scan_file_obstack);
- cpp_init (); /* Initialize cpplib. */
- cpp_reader_init (&scan_in, CLK_GNUC89);
- scan_in.cb.change_file = cb_change_file;
+ scan_in = cpp_create_reader (CLK_GNUC89);
+ scan_in->cb.change_file = cb_change_file;
/* We are going to be scanning a header file out of its proper context,
so ignore warnings and errors. */
- CPP_OPTION (&scan_in, inhibit_warnings) = 1;
- CPP_OPTION (&scan_in, inhibit_errors) = 1;
- i = cpp_handle_options (&scan_in, argc, argv);
- if (i < argc && ! CPP_FATAL_ERRORS (&scan_in))
- cpp_fatal (&scan_in, "Invalid option `%s'", argv[i]);
- if (CPP_FATAL_ERRORS (&scan_in))
+ CPP_OPTION (scan_in, inhibit_warnings) = 1;
+ CPP_OPTION (scan_in, inhibit_errors) = 1;
+ i = cpp_handle_options (scan_in, argc, argv);
+ if (i < argc && ! CPP_FATAL_ERRORS (scan_in))
+ cpp_fatal (scan_in, "Invalid option `%s'", argv[i]);
+ if (CPP_FATAL_ERRORS (scan_in))
exit (FATAL_EXIT_CODE);
- if (! cpp_start_read (&scan_in, in_fname))
+ if (! cpp_start_read (scan_in, in_fname))
exit (FATAL_EXIT_CODE);
/* We are scanning a system header, so mark it as such. */
- cpp_make_system_header (&scan_in, CPP_BUFFER (&scan_in), 1);
+ cpp_make_system_header (scan_in, CPP_BUFFER (scan_in), 1);
- scan_decls (&scan_in, argc, argv);
+ scan_decls (scan_in, argc, argv);
for (cur_symbols = &symbol_table[0]; cur_symbols->names; cur_symbols++)
- check_macro_names (&scan_in, cur_symbols->names);
+ check_macro_names (scan_in, cur_symbols->names);
/* Traditionally, getc and putc are defined in terms of _filbuf and _flsbuf.
If so, those functions are also required. */
@@ -650,8 +649,8 @@ read_scan_file (in_fname, argc, argv)
{
static const unsigned char getchar_call[] = "getchar();";
int seen_filbuf = 0;
- cpp_buffer *buf = CPP_BUFFER (&scan_in);
- if (cpp_push_buffer (&scan_in, getchar_call,
+ cpp_buffer *buf = CPP_BUFFER (scan_in);
+ if (cpp_push_buffer (scan_in, getchar_call,
sizeof(getchar_call) - 1) == NULL)
return;
@@ -660,11 +659,11 @@ read_scan_file (in_fname, argc, argv)
{
cpp_token t;
- cpp_get_token (&scan_in, &t);
+ cpp_get_token (scan_in, &t);
if (t.type == CPP_EOF)
{
- cpp_pop_buffer (&scan_in);
- if (CPP_BUFFER (&scan_in) == buf)
+ cpp_pop_buffer (scan_in);
+ if (CPP_BUFFER (scan_in) == buf)
break;
}
else if (cpp_ideq (&t, "_filbuf"))