aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDave Brolley <brolley@cygnus.com>1998-05-21 08:56:16 +0000
committerDave Brolley <brolley@gcc.gnu.org>1998-05-21 04:56:16 -0400
commitd4dfe7d66cd2d6141684e2b686a4c3bc7bddbf39 (patch)
treeeef30a280f20182a30315e033111a637b91ff67d /gcc
parentc87248620c69e3cc5234e16889c7051b372cb61a (diff)
downloadgcc-d4dfe7d66cd2d6141684e2b686a4c3bc7bddbf39.zip
gcc-d4dfe7d66cd2d6141684e2b686a4c3bc7bddbf39.tar.gz
gcc-d4dfe7d66cd2d6141684e2b686a4c3bc7bddbf39.tar.bz2
lex.c: (handle_sysv_pragma): FILE* parameter not used.
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog15
-rw-r--r--gcc/cp/Makefile.in3
-rw-r--r--gcc/cp/cp-tree.h6
-rw-r--r--gcc/cp/input.c10
-rw-r--r--gcc/cp/lex.c28
5 files changed, 48 insertions, 14 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b0607c0..e0a3399 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/Makefile.in b/gcc/cp/Makefile.in
index 85bb833..e4ebf24 100644
--- a/gcc/cp/Makefile.in
+++ b/gcc/cp/Makefile.in
@@ -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
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index abcd31c..38b277c 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -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. */
diff --git a/gcc/cp/input.c b/gcc/cp/input.c
index 5e4fd5f..5a73fea 100644
--- a/gcc/cp/input.c
+++ b/gcc/cp/input.c
@@ -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
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 36a0368..07109e4 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -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 (;;)