This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

cpplib: More interface cleanups


This combines cpp_init() and cpp_reader_init() into
cpp_create_reader() for a slightly simpler, better interface, and
updates all affected code.

This is some more work towards reducing the interface exposed in
cpplib.h and reducing implementation assumptions clients can make.  In
particular I want to make the cpp_reader structure opaque.

Bootstrapped x86 Linux.

Neil.

	* 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.

Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.184
diff -u -p -r1.184 c-decl.c
--- c-decl.c	2000/11/26 10:48:48	1.184
+++ c-decl.c	2000/11/28 20:32:37
@@ -509,7 +509,7 @@ c_decode_option (argc, argv)
   const char *option_value = NULL;
   char *p = argv[0];
 
-  strings_processed = cpp_handle_option (&parse_in, argc, argv);
+  strings_processed = cpp_handle_option (parse_in, argc, argv);
 
   if (!strcmp (p, "-lang-objc"))
     c_language = clk_objective_c;
Index: c-lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-lang.c,v
retrieving revision 1.39
diff -u -p -r1.39 c-lang.c
--- c-lang.c	2000/11/26 10:48:48	1.39
+++ c-lang.c	2000/11/28 20:32:44
@@ -52,8 +52,7 @@ lang_decode_option (argc, argv)
 void
 lang_init_options ()
 {
-  cpp_init ();
-  cpp_reader_init (&parse_in, CLK_GNUC89);
+  parse_in = cpp_create_reader (CLK_GNUC89);
 
   /* Mark as "unspecified".  */
   flag_bounds_check = -1;
Index: c-lex.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-lex.c,v
retrieving revision 1.118
diff -u -p -r1.118 c-lex.c
--- c-lex.c	2000/11/27 08:00:03	1.118
+++ c-lex.c	2000/11/28 20:32:46
@@ -122,12 +122,12 @@ init_c_lex (filename)
   GET_ENVIRONMENT (literal_codeset, "LANG");
 #endif
 
-  parse_in.cb.ident = cb_ident;
-  parse_in.cb.change_file = cb_change_file;
-  parse_in.cb.def_pragma = cb_def_pragma;
+  parse_in->cb.ident = cb_ident;
+  parse_in->cb.change_file = cb_change_file;
+  parse_in->cb.def_pragma = cb_def_pragma;
 
-  /* Make sure parse_in.digraphs matches flag_digraphs.  */
-  CPP_OPTION (&parse_in, digraphs) = flag_digraphs;
+  /* Make sure parse_in->digraphs matches flag_digraphs.  */
+  CPP_OPTION (parse_in, digraphs) = flag_digraphs;
 
   if (filename == 0 || !strcmp (filename, "-"))
     filename = "stdin";
@@ -145,7 +145,7 @@ init_c_lex (filename)
 int
 yyparse()
 {
-  if (! cpp_start_read (&parse_in, orig_filename))
+  if (! cpp_start_read (parse_in, orig_filename))
     return 1;			/* cpplib has emitted an error.  */
 
   return yyparse_1();
@@ -951,13 +951,13 @@ c_lex (value)
 
   retry:
   timevar_push (TV_CPP);
-  cpp_get_token (&parse_in, &tok);
+  cpp_get_token (parse_in, &tok);
   timevar_pop (TV_CPP);
 
   /* The C++ front end does horrible things with the current line
      number.  To ensure an accurate line number, we must reset it
      every time we return a token.  */
-  lex_lineno = cpp_get_line (&parse_in)->line;
+  lex_lineno = cpp_get_line (parse_in)->line;
 
   *value = NULL_TREE;
   lineno = lex_lineno;
Index: c-lex.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-lex.h,v
retrieving revision 1.17
diff -u -p -r1.17 c-lex.h
--- c-lex.h	2000/11/26 10:50:49	1.17
+++ c-lex.h	2000/11/28 20:32:46
@@ -35,6 +35,6 @@ extern tree is_class_name PARAMS ((tree)
 extern int indent_level;
 
 struct cpp_reader;
-extern struct cpp_reader parse_in;
+extern struct cpp_reader* parse_in;
 
 #endif
Index: cppinit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppinit.c,v
retrieving revision 1.120
diff -u -p -r1.120 cppinit.c
--- cppinit.c	2000/11/27 19:08:36	1.120
+++ cppinit.c	2000/11/28 20:32:48
@@ -398,30 +398,6 @@ merge_include_chains (pfile)
   CPP_OPTION (pfile, bracket_include) = brack;
 }
 
-/* cpp_init initializes library global state.  It might not need to do
-   anything depending on the platform and compiler, so we have a static
-   flag to make sure it gets called before cpp_reader_init.  */
-
-static int cpp_init_completed = 0;
-
-void
-cpp_init ()
-{
-#ifdef HOST_EBCDIC
-  /* For non-ASCII hosts, the cl_options array needs to be sorted at
-     runtime.  */
-  qsort (cl_options, N_OPTS, sizeof (struct cl_option), opt_comp);
-#endif
-
-  /* Set up the trigraph map and the IStable.  These don't need to do
-     anything if we were compiled with a compiler that supports C99
-     designated initializers.  */
-  init_trigraph_map ();
-  init_IStable ();
-
-  cpp_init_completed = 1;
-}
-
 /* Sets internal flags correctly for a given language, and defines
    macros if necessary.  */
 static void
@@ -516,25 +492,41 @@ set_lang (pfile, lang)
     }
 }
 
+/* initialize initializes library global state.  It might not need to
+   do anything depending on the platform and compiler.  */
+
+static int initialized = 0;
+
+static void
+initialize ()
+{
+#ifdef HOST_EBCDIC
+  /* For non-ASCII hosts, the cl_options array needs to be sorted at
+     runtime.  */
+  qsort (cl_options, N_OPTS, sizeof (struct cl_option), opt_comp);
+#endif
+
+  /* Set up the trigraph map and the IStable.  These don't need to do
+     anything if we were compiled with a compiler that supports C99
+     designated initializers.  */
+  init_trigraph_map ();
+  init_IStable ();
+
+  initialized = 1;
+}
+
 /* Initialize a cpp_reader structure. */
-void
-cpp_reader_init (pfile, lang)
-     cpp_reader *pfile;
+cpp_reader *
+cpp_create_reader (lang)
      enum c_lang lang;
 {
   struct spec_nodes *s;
+  cpp_reader *pfile = (cpp_reader *) xcalloc (1, sizeof (cpp_reader));
 
-  memset ((char *) pfile, 0, sizeof (cpp_reader));
+  /* Initialise this instance of the library if it hasn't been already.  */
+  if (! initialized)
+    initialize ();
 
-  /* If cpp_init hasn't been called, generate a fatal error (by hand)
-     and call it here.  */
-  if (!cpp_init_completed)
-    {
-      fputs ("cpp_reader_init: internal error: cpp_init not called.\n", stderr);
-      pfile->errors = CPP_FATAL_LIMIT;
-      cpp_init ();
-    }
-
   CPP_OPTION (pfile, warn_import) = 1;
   CPP_OPTION (pfile, discard_comments) = 1;
   CPP_OPTION (pfile, show_column) = 1;
@@ -586,6 +578,8 @@ cpp_reader_init (pfile, lang)
   s->n__CHAR_UNSIGNED__ = cpp_lookup (pfile, DSC("__CHAR_UNSIGNED__"));
   s->n__VA_ARGS__       = cpp_lookup (pfile, DSC("__VA_ARGS__"));
   s->n__VA_ARGS__->flags |= NODE_DIAGNOSTIC;
+
+  return pfile;
 }
 
 /* Free resources used by PFILE.
Index: cpplib.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cpplib.h,v
retrieving revision 1.141
diff -u -p -r1.141 cpplib.h
--- cpplib.h	2000/11/27 19:08:36	1.141
+++ cpplib.h	2000/11/28 20:32:53
@@ -696,16 +696,14 @@ struct cpp_hashnode
   union tree_node *fe_value;		/* Front end value.  */
 };
 
+extern cpp_reader *cpp_create_reader PARAMS ((enum c_lang));
 extern unsigned int cpp_token_len PARAMS ((const cpp_token *));
 extern unsigned char *cpp_token_as_text PARAMS ((cpp_reader *,
 						 const cpp_token *));
 extern unsigned char *cpp_spell_token PARAMS ((cpp_reader *, const cpp_token *,
 					       unsigned char *));
-extern void cpp_init PARAMS ((void));
 extern int cpp_handle_options PARAMS ((cpp_reader *, int, char **));
 extern int cpp_handle_option PARAMS ((cpp_reader *, int, char **));
-extern void cpp_reader_init PARAMS ((cpp_reader *, enum c_lang));
-
 extern void cpp_register_pragma PARAMS ((cpp_reader *,
 					 const char *, const char *,
 					 void (*) PARAMS ((cpp_reader *))));
Index: cppmain.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppmain.c,v
retrieving revision 1.42
diff -u -p -r1.42 cppmain.c
--- cppmain.c	2000/11/27 08:00:04	1.42
+++ cppmain.c	2000/11/28 20:32:58
@@ -38,6 +38,8 @@ struct printer
 };
 
 int main		PARAMS ((int, char **));
+static void general_init PARAMS ((const char *));
+static void setup_callbacks PARAMS ((void));
 
 /* General output routines.  */
 static void scan_buffer	PARAMS ((cpp_reader *));
@@ -58,8 +60,8 @@ static void cb_change_file PARAMS ((cpp_
 static void cb_def_pragma PARAMS ((cpp_reader *));
 static void do_pragma_implementation PARAMS ((cpp_reader *));
 
-const char *progname;
-static cpp_reader parse_in;
+const char *progname;		/* Needs to be global.  */
+static cpp_reader *pfile;
 static struct printer print;
 
 int
@@ -67,25 +69,11 @@ main (argc, argv)
      int argc;
      char **argv;
 {
-  char *p;
-  cpp_reader *pfile = &parse_in;
   int argi = 1;  /* Next argument to handle.  */
 
-  p = argv[0] + strlen (argv[0]);
-  while (p != argv[0] && ! IS_DIR_SEPARATOR (p[-1])) --p;
-  progname = p;
-
-  xmalloc_set_program_name (progname);
-
-#ifdef HAVE_LC_MESSAGES
-  setlocale (LC_MESSAGES, "");
-#endif
-  (void) bindtextdomain (PACKAGE, localedir);
-  (void) textdomain (PACKAGE);
-
-  cpp_init ();
+  general_init (argv[0]);
   /* Default language is GNU C89.  */
-  cpp_reader_init (pfile, CLK_GNUC89);
+  pfile = cpp_create_reader (CLK_GNUC89);
   
   argi += cpp_handle_options (pfile, argc - argi , argv + argi);
   if (argi < argc && ! CPP_FATAL_ERRORS (pfile))
@@ -99,31 +87,8 @@ main (argc, argv)
   if (printer_init (pfile))
     return (FATAL_EXIT_CODE);
 
-  /* Set callbacks.  */
-  if (! CPP_OPTION (pfile, no_output))
-    {
-      pfile->cb.ident      = cb_ident;
-      pfile->cb.def_pragma = cb_def_pragma;
-      if (! CPP_OPTION (pfile, no_line_commands))
-	pfile->cb.change_file = cb_change_file;
-    }
+  setup_callbacks ();
 
-  if (CPP_OPTION (pfile, dump_includes))
-    pfile->cb.include  = cb_include;
-
-  if (CPP_OPTION (pfile, debug_output)
-      || CPP_OPTION (pfile, dump_macros) == dump_names
-      || CPP_OPTION (pfile, dump_macros) == dump_definitions)
-    {
-      pfile->cb.define = cb_define;
-      pfile->cb.undef  = cb_undef;
-      pfile->cb.poison = cb_def_pragma;
-    }
-
-  /* Register one #pragma which needs special handling.  */
-  cpp_register_pragma(pfile, 0, "implementation", do_pragma_implementation);
-  cpp_register_pragma(pfile, "GCC", "implementation", do_pragma_implementation);
-
   if (! cpp_start_read (pfile, CPP_OPTION (pfile, in_fname)))
     return (FATAL_EXIT_CODE);
 
@@ -148,9 +113,57 @@ main (argc, argv)
   if (ferror (print.outf) || fclose (print.outf))
     cpp_notice_from_errno (pfile, CPP_OPTION (pfile, out_fname));
 
-  if (parse_in.errors)
+  if (pfile->errors)
     return (FATAL_EXIT_CODE);
   return (SUCCESS_EXIT_CODE);
+}
+
+/* Store the program name, and set the locale.  */
+static void
+general_init (const char *argv0)
+{
+  progname = argv0 + strlen (argv0);
+
+  while (progname != argv0 && ! IS_DIR_SEPARATOR (progname[-1]))
+    --progname;
+
+  xmalloc_set_program_name (progname);
+
+#ifdef HAVE_LC_MESSAGES
+  setlocale (LC_MESSAGES, "");
+#endif
+  (void) bindtextdomain (PACKAGE, localedir);
+  (void) textdomain (PACKAGE);
+}
+
+/* Set up the callbacks and register the pragmas we handle.  */
+static void
+setup_callbacks ()
+{
+  /* Set callbacks.  */
+  if (! CPP_OPTION (pfile, no_output))
+    {
+      pfile->cb.ident      = cb_ident;
+      pfile->cb.def_pragma = cb_def_pragma;
+      if (! CPP_OPTION (pfile, no_line_commands))
+	pfile->cb.change_file = cb_change_file;
+    }
+
+  if (CPP_OPTION (pfile, dump_includes))
+    pfile->cb.include  = cb_include;
+
+  if (CPP_OPTION (pfile, debug_output)
+      || CPP_OPTION (pfile, dump_macros) == dump_names
+      || CPP_OPTION (pfile, dump_macros) == dump_definitions)
+    {
+      pfile->cb.define = cb_define;
+      pfile->cb.undef  = cb_undef;
+      pfile->cb.poison = cb_def_pragma;
+    }
+
+  /* Register one #pragma which needs special handling.  */
+  cpp_register_pragma(pfile, 0, "implementation", do_pragma_implementation);
+  cpp_register_pragma(pfile, "GCC", "implementation", do_pragma_implementation);
 }
 
 /* Writes out the preprocessed file.  Alternates between two tokens,
Index: fix-header.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fix-header.c,v
retrieving revision 1.53
diff -u -p -r1.53 fix-header.c
--- fix-header.c	2000/11/27 08:00:04	1.53
+++ fix-header.c	2000/11/28 20:33:06
@@ -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"))
Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl2.c,v
retrieving revision 1.412
diff -u -p -r1.412 decl2.c
--- decl2.c	2000/11/26 10:48:50	1.412
+++ decl2.c	2000/11/28 20:33:33
@@ -46,7 +46,7 @@ Boston, MA 02111-1307, USA.  */
 #include "ggc.h"
 #include "timevar.h"
 #include "cpplib.h"
-extern cpp_reader  parse_in;
+extern cpp_reader *parse_in;
 
 /* This structure contains information about the initializations
    and/or destructions required for a particular priority level.  */
@@ -569,7 +569,7 @@ lang_decode_option (argc, argv)
   int strings_processed;
   const char *p = argv[0];
 
-  strings_processed = cpp_handle_option (&parse_in, argc, argv);
+  strings_processed = cpp_handle_option (parse_in, argc, argv);
 
   if (!strcmp (p, "-ftraditional") || !strcmp (p, "-traditional"))
     /* ignore */;
Index: cp/lex.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/lex.c,v
retrieving revision 1.229
diff -u -p -r1.229 lex.c
--- lex.c	2000/11/26 10:48:50	1.229
+++ lex.c	2000/11/28 20:33:37
@@ -79,7 +79,6 @@ static void init_operators PARAMS ((void
 #endif
 
 #include "cpplib.h"
-extern cpp_reader  parse_in;
 
 /* Pending language change.
    Positive is push count, negative is pop count.  */
@@ -246,8 +245,7 @@ static const char *cplus_tree_code_name[
 void
 lang_init_options ()
 {
-  cpp_init ();
-  cpp_reader_init (&parse_in, CLK_GNUCXX);
+  parse_in = cpp_create_reader (CLK_GNUCXX);
 
   /* Default exceptions on.  */
   flag_exceptions = 1;
@@ -661,16 +659,16 @@ init_reswords ()
 static void
 init_cp_pragma ()
 {
-  cpp_register_pragma (&parse_in, 0, "vtable", handle_pragma_vtable);
-  cpp_register_pragma (&parse_in, 0, "unit", handle_pragma_unit);
+  cpp_register_pragma (parse_in, 0, "vtable", handle_pragma_vtable);
+  cpp_register_pragma (parse_in, 0, "unit", handle_pragma_unit);
 
-  cpp_register_pragma (&parse_in, 0, "interface", handle_pragma_interface);
-  cpp_register_pragma (&parse_in, 0, "implementation",
+  cpp_register_pragma (parse_in, 0, "interface", handle_pragma_interface);
+  cpp_register_pragma (parse_in, 0, "implementation",
 		       handle_pragma_implementation);
 
-  cpp_register_pragma_space (&parse_in, "GCC");
-  cpp_register_pragma (&parse_in, "GCC", "interface", handle_pragma_interface);
-  cpp_register_pragma (&parse_in, "GCC", "implementation",
+  cpp_register_pragma_space (parse_in, "GCC");
+  cpp_register_pragma (parse_in, "GCC", "interface", handle_pragma_interface);
+  cpp_register_pragma (parse_in, "GCC", "implementation",
 		       handle_pragma_implementation);
 }
 
@@ -742,8 +740,8 @@ init_parse (filename)
 void
 finish_parse ()
 {
-  cpp_finish (&parse_in);
-  errorcount += parse_in.errors;
+  cpp_finish (parse_in);
+  errorcount += parse_in->errors;
 }
 
 inline void
@@ -1150,7 +1148,7 @@ handle_pragma_implementation (dfile)
   else
     {
       main_filename = TREE_STRING_POINTER (fname);
-      if (cpp_included (&parse_in, main_filename))
+      if (cpp_included (parse_in, main_filename))
 	warning ("#pragma implementation for %s appears after file is included",
 		 main_filename);
     }
Index: cp/spew.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/spew.c,v
retrieving revision 1.40
diff -u -p -r1.40 spew.c
--- spew.c	2000/11/28 10:23:03	1.40
+++ spew.c	2000/11/28 20:33:42
@@ -323,8 +323,8 @@ read_token (t)
 #undef YYCODE
 
     case CPP_EOF:
-      cpp_pop_buffer (&parse_in);
-      if (CPP_BUFFER (&parse_in))
+      cpp_pop_buffer (parse_in);
+      if (CPP_BUFFER (parse_in))
 	goto retry;
       t->yychar = 0;
       break;
Index: objc/objc-act.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-act.c,v
retrieving revision 1.54
diff -u -p -r1.54 objc-act.c
--- objc-act.c	2000/11/25 19:28:44	1.54
+++ objc-act.c	2000/11/28 20:34:07
@@ -56,7 +56,6 @@ Boston, MA 02111-1307, USA.  */
 #include "toplev.h"
 #include "ggc.h"
 #include "cpplib.h"
-extern cpp_reader  parse_in;
 
 /* This is the default way of generating a method name.  */
 /* I am not sure it is really correct.
@@ -695,8 +694,7 @@ generate_struct_by_value_array ()
 void
 lang_init_options ()
 {
-  cpp_init ();
-  cpp_reader_init (&parse_in, CLK_GNUC89);
+  parse_in = cpp_create_reader (CLK_GNUC89);
 }
 
 void

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]