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: remove cppulp.c


This patch moves the global user_label_prefix to a cpp_reader's
options strucutre, since it can be set on the command line.

Neil.

	* Makefile.in: Remove references to cppulp.{c,o}.
	* cppinit.c (initialize_builtins, cpp_start_read,
	cpp_handle_option): Update to use cpp_options structure.
	* cppulp.c: Remove.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Makefile.in,v
retrieving revision 1.504
diff -u -p -r1.504 Makefile.in
--- Makefile.in	2000/09/06 14:45:27	1.504
+++ Makefile.in	2000/09/06 18:55:07
@@ -1798,7 +1798,7 @@ PREPROCESSOR_DEFINES = \
   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\"
 
 LIBCPP_OBJS =	cpplib.o cpplex.o cppmacro.o cppexp.o cppfiles.o \
-		cpphash.o cpperror.o cppinit.o cppulp.o cppdefault.o \
+		cpphash.o cpperror.o cppinit.o cppdefault.o \
 		mkdeps.o prefix.o version.o mbchar.o @extra_cpp_objs@
 
 LIBCPP_DEPS =	cpplib.h cpphash.h intl.h system.h
@@ -1816,7 +1816,6 @@ cpp0$(exeext): cppmain.o intl.o libcpp.a
 
 cppmain.o:  cppmain.c  $(CONFIG_H) cpplib.h intl.h system.h
 
-cppulp.o:   cppulp.c   $(CONFIG_H) system.h output.h
 cpperror.o: cpperror.c $(CONFIG_H) $(LIBCPP_DEPS)
 cppexp.o:   cppexp.c   $(CONFIG_H) $(LIBCPP_DEPS)
 cpplex.o:   cpplex.c   $(CONFIG_H) $(LIBCPP_DEPS)
Index: cppinit.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cppinit.c,v
retrieving revision 1.107
diff -u -p -r1.107 cppinit.c
--- cppinit.c	2000/08/29 18:37:36	1.107
+++ cppinit.c	2000/09/06 18:55:13
@@ -598,6 +598,7 @@ initialize_builtins (pfile)
      cpp_reader *pfile;
 {
   const struct builtin *b;
+
   for(b = builtin_array; b < builtin_array_end; b++)
     {
       if (b->flags & CPLUS && ! CPP_OPTION (pfile, cplusplus))
@@ -617,7 +618,7 @@ initialize_builtins (pfile)
 	  else
 	    {
 	      if (b->flags & ULP)
-		val = user_label_prefix;
+		val = CPP_OPTION (pfile, user_label_prefix);
 	      else
 		val = b->value;
 
@@ -825,8 +826,8 @@ cpp_start_read (pfile, print, fname)
     CPP_OPTION (pfile, warn_paste) = 0;
 
   /* Set this if it hasn't been set already. */
-  if (user_label_prefix == NULL)
-    user_label_prefix = USER_LABEL_PREFIX;
+  if (CPP_OPTION (pfile, user_label_prefix) == NULL)
+    CPP_OPTION (pfile, user_label_prefix) = USER_LABEL_PREFIX;
 
   /* Figure out if we need to save function macro parameter spellings.
      We don't use CPP_PEDANTIC() here because that depends on whether
@@ -1224,10 +1225,10 @@ cpp_handle_option (pfile, argc, argv)
 	case N_OPTS: /* shut GCC up */
 	  break;
 	case OPT_fleading_underscore:
-	  user_label_prefix = "_";
+	  CPP_OPTION (pfile, user_label_prefix) = "_";
 	  break;
 	case OPT_fno_leading_underscore:
-	  user_label_prefix = "";
+	  CPP_OPTION (pfile, user_label_prefix) = "";
 	  break;
 	case OPT_fpreprocessed:
 	  CPP_OPTION (pfile, preprocessed) = 1;
Index: cpplib.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cpplib.h,v
retrieving revision 1.118
diff -u -p -r1.118 cpplib.h
--- cpplib.h	2000/08/17 17:52:48	1.118
+++ cpplib.h	2000/09/06 18:55:15
@@ -298,6 +298,9 @@ struct cpp_options
   const char *include_prefix;
   unsigned int include_prefix_len;
 
+  /* -fleading_underscore sets this to "_".  */
+  const char *user_label_prefix;
+
   /* Non-0 means -v, so print the full set of include dirs.  */
   unsigned char verbose;
 
Index: cppulp.c
===================================================================
RCS file: cppulp.c
diff -N cppulp.c
--- /sourceware/cvs-tmp/cvsUKra6r	Wed Sep  6 11:55:43 2000
+++ /dev/null	Tue May  5 13:32:27 1998
@@ -1,27 +0,0 @@
-/* CPP Library.
-   Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999 Free Software Foundation, Inc.
-   Contributed by Per Bothner, 1994-95.
-   Based on CCCP program by Paul Rubin, June 1986
-   Adapted to ANSI C, Richard Stallman, Jan 1987
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#include "config.h"
-#include "system.h"
-
-#include "output.h"
-
-const char *user_label_prefix = 0;

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