lex.c: (handle_sysv_pragma): FILE* parameter not used.
authorDave Brolley <brolley@cygnus.com>
Thu, 21 May 1998 08:56:16 +0000 (08:56 +0000)
committerDave Brolley <brolley@gcc.gnu.org>
Thu, 21 May 1998 08:56:16 +0000 (04:56 -0400)
Thu May 21 11:54:44 1998  Dave Brolley  <brolley@cygnus.com>
* lex.c: (handle_sysv_pragma): FILE* parameter not used.
(cpp_reader,parse_in): Add for cpplib.
(check_newline): Call handle_sysv_pragma with new interface.
(check_newline): Call GET_DIRECTIVE_LINE, not get_directive_line.
* input.c: (yy_cur,yy_lim,yy_get_token,GETC): Add for cpplib.
(sub_getch): Call GETC for cpplib.
* cp-tree.h: (get_directive_line): Different prototype for cpplib.
(GET_DIRECTIVE_LINE): Macro wrapper for get_directive_line.
* Makefile.in (CXX_OBJS): add @extra_cxx_objs@ for cpplib.

From-SVN: r19927

gcc/cp/ChangeLog
gcc/cp/Makefile.in
gcc/cp/cp-tree.h
gcc/cp/input.c
gcc/cp/lex.c

index b0607c0..e0a3399 100644 (file)
@@ -1,3 +1,18 @@
+Thu May 21 11:54:44 1998  Dave Brolley  <brolley@cygnus.com>
+
+       * lex.c: (handle_sysv_pragma): FILE* parameter not used.
+       (cpp_reader,parse_in): Add for cpplib.
+       (check_newline): Call handle_sysv_pragma with new interface.
+       (check_newline): Call GET_DIRECTIVE_LINE, not get_directive_line.
+
+       * input.c: (yy_cur,yy_lim,yy_get_token,GETC): Add for cpplib.
+       (sub_getch): Call GETC for cpplib.
+
+       * cp-tree.h: (get_directive_line): Different prototype for cpplib.
+       (GET_DIRECTIVE_LINE): Macro wrapper for get_directive_line.
+
+       * Makefile.in (CXX_OBJS): add @extra_cxx_objs@ for cpplib.
+
 1998-05-21  Jason Merrill  <jason@yorick.cygnus.com>
 
        * decl2.c (maybe_make_one_only): New fn.
index 85bb833..e4ebf24 100644 (file)
@@ -176,7 +176,8 @@ INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config
 
 CXX_OBJS = call.o decl.o errfn.o expr.o pt.o sig.o typeck2.o \
  class.o decl2.o error.o lex.o parse.o ptree.o rtti.o spew.o typeck.o cvt.o \
- except.o friend.o init.o method.o search.o semantics.o tree.o xref.o repo.o
+ except.o friend.o init.o method.o search.o semantics.o tree.o xref.o repo.o \
+ @extra_cxx_objs@
 
 # Language-independent object files.
 OBJS = `cat ../stamp-objlist` ../c-common.o ../c-pragma.o
index abcd31c..38b277c 100644 (file)
@@ -1639,7 +1639,13 @@ extern tree convert_and_check                    PROTO((tree, tree));
 extern void overflow_warning                   PROTO((tree));
 extern void unsigned_conversion_warning                PROTO((tree, tree));
 /* Read the rest of the current #-directive line.  */
+#if USE_CPPLIB
+extern char *get_directive_line                 PROTO((void));
+#define GET_DIRECTIVE_LINE() get_directive_line ()
+#else
 extern char *get_directive_line                 PROTO((FILE *));
+#define GET_DIRECTIVE_LINE() get_directive_line (finput)
+#endif
 /* Subroutine of build_binary_op, used for comparison operations.
    See if the operands have both been converted from subword integer types
    and, if so, perhaps change them both back to their original type.  */
index 5e4fd5f..5a73fea 100644 (file)
@@ -59,6 +59,14 @@ extern int lineno;
 #define inline
 #endif
 
+#if USE_CPPLIB
+extern unsigned char *yy_cur, *yy_lim;
+extern int yy_get_token ();
+#define GETC() (yy_cur < yy_lim ? *yy_cur++ : yy_get_token ())
+#else
+#define GETC() getc (finput)
+#endif
+
 extern void feed_input PROTO((char *, int));
 extern void put_input PROTO((int));
 extern void put_back PROTO((int));
@@ -168,7 +176,7 @@ sub_getch ()
        }
       return (unsigned char)input->str[input->offset++];
     }
-  return getc (finput);
+  return GETC ();
 }
 
 inline
index 36a0368..07109e4 100644 (file)
@@ -83,7 +83,7 @@ static void reinit_parse_for_expr PROTO((struct obstack *));
 static int *init_cpp_parse PROTO((void));
 static int handle_cp_pragma PROTO((char *));
 #ifdef HANDLE_SYSV_PRAGMA
-static int handle_sysv_pragma PROTO((FILE *, int));
+static int handle_sysv_pragma PROTO((int));
 #endif
 #ifdef GATHER_STATISTICS
 #ifdef REDUCE_LENGTH
@@ -112,7 +112,10 @@ file_name_nondirectory (x)
 struct obstack inline_text_obstack;
 char *inline_text_firstobj;
 
-#if !USE_CPPLIB
+#if USE_CPPLIB
+#include "cpplib.h"
+extern cpp_reader parse_in;
+#else
 FILE *finput;
 #endif
 int end_of_file;
@@ -2198,9 +2201,6 @@ get_last_nonwhite_on_line ()
 
 int linemode;
 
-#ifdef HANDLE_SYSV_PRAGMA
-static int handle_sysv_pragma PROTO((FILE *, int));
-#endif
 static int handle_cp_pragma PROTO((char *));
 
 static int
@@ -2261,12 +2261,17 @@ check_newline ()
                goto skipline;
 
 #ifdef HANDLE_SYSV_PRAGMA
-             if (handle_sysv_pragma (finput, token))
+             if (handle_sysv_pragma (token))
                goto skipline;
 #else
 #ifdef HANDLE_PRAGMA
-             if (HANDLE_PRAGMA (finput, yylval.ttype))
-               goto skipline;
+#if USE_CPPLIB
+              /* TODO: ??? */
+              goto skipline;
+#else
+             if (HANDLE_PRAGMA (finput, yylval.ttype))
+               goto skipline;
+#endif /* !USE_CPPLIB */
 #endif
 #endif
            }
@@ -2281,7 +2286,7 @@ check_newline ()
              && getch () == 'e'
              && ((c = getch ()) == ' ' || c == '\t'))
            {
-             debug_define (lineno, get_directive_line (finput));
+             debug_define (lineno, GET_DIRECTIVE_LINE ());
              goto skipline;
            }
        }
@@ -2293,7 +2298,7 @@ check_newline ()
              && getch () == 'f'
              && ((c = getch ()) == ' ' || c == '\t'))
            {
-             debug_undef (lineno, get_directive_line (finput));
+             debug_undef (lineno, GET_DIRECTIVE_LINE ());
              goto skipline;
            }
        }
@@ -4749,8 +4754,7 @@ handle_cp_pragma (pname)
    the token types.  */
 
 static int
-handle_sysv_pragma (finput, token)
-     FILE *finput;
+handle_sysv_pragma (token)
      register int token;
 {
   for (;;)