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]
Other format: [Raw text]

Kill CPP_PREDEFINES


This removes and poisons CPP_PREDEFINES.  I'll apply it when the m68k patch is
approved.

Neil.

	* defaults.h (TARGET_CPU_CPP_BUILTINS, CPP_PREDEFINES): Remove.
	* gcc.c (cpp_predefines): Remove.
	(cpp_unique_options, do_spec_1): Remove handling of CPP_PREDEFINES.
	(static_specs): Remove predefines.
	* system.h: Poison CPP_PREDEFINES.
	* config/freebsd.h, config/openbsd.h, config/ptx4.h, config/svr3.h,
	config/svr4.h, doc/tm.texi: Remove references to CPP_PREDEFINES.

============================================================
Index: gcc/defaults.h
*** gcc/defaults.h	17 May 2003 01:40:40 -0000	1.106
--- gcc/defaults.h	17 May 2003 14:33:52 -0000
*************** Software Foundation, 59 Temple Place - S
*** 47,62 ****
  #  define TARGET_ESC 033
  #endif
  
- /* When removal of CPP_PREDEFINES is complete, TARGET_CPU_CPP_BULITINS
-    can also be removed from here.  */
  #ifndef TARGET_OS_CPP_BUILTINS
  # define TARGET_OS_CPP_BUILTINS()
- #endif
- #ifndef TARGET_CPU_CPP_BUILTINS
- # define TARGET_CPU_CPP_BUILTINS()
- #endif
- #ifndef CPP_PREDEFINES
- # define CPP_PREDEFINES ""
  #endif
  
  /* Store in OUTPUT a string (made with alloca) containing an
--- 47,54 ----
============================================================
Index: gcc/gcc.c
*** gcc/gcc.c	7 May 2003 06:10:49 -0000	1.374
--- gcc/gcc.c	17 May 2003 14:33:54 -0000
*************** or with constant text in a single argume
*** 448,458 ****
  	except that %g, %u, and %U do not currently support additional
  	SUFFIX characters following %O as they would following, for
  	example, `.o'.
-  %p	substitutes the standard macro predefinitions for the
- 	current target machine.  Use this when running cpp.
-  %P	like %p, but puts `__' before and after the name of each macro.
- 	(Except macros that already have __.)
- 	This is for ANSI C.
   %I	Substitute any of -iprefix (made from GCC_EXEC_PREFIX), -isysroot
  	(made from TARGET_SYSTEM_ROOT), and -isystem (made from COMPILER_PATH
  	and -B options) as necessary.
--- 448,453 ----
*************** proper position among the other output f
*** 701,707 ****
  
  static const char *asm_debug;
  static const char *cpp_spec = CPP_SPEC;
- static const char *cpp_predefines = CPP_PREDEFINES;
  static const char *cc1_spec = CC1_SPEC;
  static const char *cc1plus_spec = CC1PLUS_SPEC;
  static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
--- 696,701 ----
*************** static const char *cpp_unique_options =
*** 740,747 ****
   %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}}\
   %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
   %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}}\
!  %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
!  %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i\
   %{E|M|MM:%W{o*}}";
  
  /* This contains cpp options which are common with cc1_options and are passed
--- 734,740 ----
   %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}}\
   %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
   %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}}\
!  %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i\
   %{E|M|MM:%W{o*}}";
  
  /* This contains cpp options which are common with cc1_options and are passed
*************** static struct spec_list static_specs[] =
*** 1467,1473 ****
    INIT_STATIC_SPEC ("libgcc",			&libgcc_spec),
    INIT_STATIC_SPEC ("startfile",		&startfile_spec),
    INIT_STATIC_SPEC ("switches_need_spaces",	&switches_need_spaces),
-   INIT_STATIC_SPEC ("predefines",		&cpp_predefines),
    INIT_STATIC_SPEC ("cross_compile",		&cross_compile),
    INIT_STATIC_SPEC ("version",			&compiler_version),
    INIT_STATIC_SPEC ("multilib",			&multilib_select),
--- 1460,1465 ----
*************** do_spec_1 (spec, inswitch, soft_matched_
*** 4966,5132 ****
  		for (q = multilib_dir; *q ; ++q, ++p)
  		  *p = (IS_DIR_SEPARATOR (*q) ? '_' : *q);
  	      }
- 	    break;
- 
- 	  case 'p':
- 	    {
- 	      char *x = (char *) alloca (strlen (cpp_predefines) + 1);
- 	      char *buf = x;
- 	      const char *y;
- 
- 	      /* Copy all of the -D options in CPP_PREDEFINES into BUF.  */
- 	      y = cpp_predefines;
- 	      while (*y != 0)
- 		{
- 		  if (! strncmp (y, "-D", 2))
- 		    /* Copy the whole option.  */
- 		    while (*y && *y != ' ' && *y != '\t')
- 		      *x++ = *y++;
- 		  else if (*y == ' ' || *y == '\t')
- 		    /* Copy whitespace to the result.  */
- 		    *x++ = *y++;
- 		  /* Don't copy other options.  */
- 		  else
- 		    y++;
- 		}
- 
- 	      *x = 0;
- 
- 	      value = do_spec_1 (buf, 0, NULL);
- 	      if (value != 0)
- 		return value;
- 	    }
- 	    break;
- 
- 	  case 'P':
- 	    {
- 	      char *x = (char *) alloca (strlen (cpp_predefines) * 4 + 1);
- 	      char *buf = x;
- 	      const char *y;
- 
- 	      /* Copy all of CPP_PREDEFINES into BUF,
- 		 but force them all into the reserved name space if they
- 		 aren't already there.  The reserved name space is all
- 		 identifiers beginning with two underscores or with one
- 		 underscore and a capital letter.  We do the forcing by
- 		 adding up to two underscores to the beginning and end
- 		 of each symbol. e.g. mips, _mips, mips_, and _mips_ all
- 		 become __mips__.  */
- 	      y = cpp_predefines;
- 	      while (*y != 0)
- 		{
- 		  if (! strncmp (y, "-D", 2))
- 		    {
- 		      int flag = 0;
- 
- 		      *x++ = *y++;
- 		      *x++ = *y++;
- 
- 		      if (*y != '_'
- 			  || (*(y + 1) != '_'
- 			      && ! ISUPPER ((unsigned char) *(y + 1))))
- 			{
- 			  /* Stick __ at front of macro name.  */
- 			  if (*y != '_')
- 			    *x++ = '_';
- 			  *x++ = '_';
- 			  /* Arrange to stick __ at the end as well.  */
- 			  flag = 1;
- 			}
- 
- 		      /* Copy the macro name.  */
- 		      while (*y && *y != '=' && *y != ' ' && *y != '\t')
- 			*x++ = *y++;
- 
- 		      if (flag)
- 			{
- 			  if (x[-1] != '_')
- 			    {
- 			      if (x[-2] != '_')
- 				*x++ = '_';
- 			      *x++ = '_';
- 			    }
- 			}
- 
- 		      /* Copy the value given, if any.  */
- 		      while (*y && *y != ' ' && *y != '\t')
- 			*x++ = *y++;
- 		    }
- 		  else if (*y == ' ' || *y == '\t')
- 		    /* Copy whitespace to the result.  */
- 		    *x++ = *y++;
- 		  /* Don't copy -A options  */
- 		  else
- 		    y++;
- 		}
- 	      *x++ = ' ';
- 
- 	      /* Copy all of CPP_PREDEFINES into BUF,
- 		 but put __ after every -D.  */
- 	      y = cpp_predefines;
- 	      while (*y != 0)
- 		{
- 		  if (! strncmp (y, "-D", 2))
- 		    {
- 		      y += 2;
- 
- 		      if (*y != '_'
- 			  || (*(y + 1) != '_'
- 			      && ! ISUPPER ((unsigned char) *(y + 1))))
- 			{
- 			  /* Stick -D__ at front of macro name.  */
- 			  *x++ = '-';
- 			  *x++ = 'D';
- 			  if (*y != '_')
- 			    *x++ = '_';
- 			  *x++ = '_';
- 
- 			  /* Copy the macro name.  */
- 			  while (*y && *y != '=' && *y != ' ' && *y != '\t')
- 			    *x++ = *y++;
- 
- 			  /* Copy the value given, if any.  */
- 			  while (*y && *y != ' ' && *y != '\t')
- 			    *x++ = *y++;
- 			}
- 		      else
- 			{
- 			  /* Do not copy this macro - we have just done it before */
- 			  while (*y && *y != ' ' && *y != '\t')
- 			    y++;
- 			}
- 		    }
- 		  else if (*y == ' ' || *y == '\t')
- 		    /* Copy whitespace to the result.  */
- 		    *x++ = *y++;
- 		  /* Don't copy -A options.  */
- 		  else
- 		    y++;
- 		}
- 	      *x++ = ' ';
- 
- 	      /* Copy all of the -A options in CPP_PREDEFINES into BUF.  */
- 	      y = cpp_predefines;
- 	      while (*y != 0)
- 		{
- 		  if (! strncmp (y, "-A", 2))
- 		    /* Copy the whole option.  */
- 		    while (*y && *y != ' ' && *y != '\t')
- 		      *x++ = *y++;
- 		  else if (*y == ' ' || *y == '\t')
- 		    /* Copy whitespace to the result.  */
- 		    *x++ = *y++;
- 		  /* Don't copy other options.  */
- 		  else
- 		    y++;
- 		}
- 
- 	      *x = 0;
- 
- 	      value = do_spec_1 (buf, 0, NULL);
- 	      if (value != 0)
- 		return value;
- 	    }
  	    break;
  
  	  case 'R':
--- 4958,4963 ----
============================================================
Index: gcc/system.h
*** gcc/system.h	14 May 2003 09:18:28 -0000	1.145
--- gcc/system.h	17 May 2003 14:33:54 -0000
*************** typedef char _Bool;
*** 628,634 ****
  /* Other obsolete target macros, or macros that used to be in target
     headers and were not used, and may be obsolete or may never have
     been used.  */
!  #pragma GCC poison INT_ASM_OP ASM_OUTPUT_EH_REGION_BEG			   \
  	ASM_OUTPUT_EH_REGION_END ASM_OUTPUT_LABELREF_AS_INT		   \
  	DOESNT_NEED_UNWINDER EH_TABLE_LOOKUP OBJC_SELECTORS_WITHOUT_LABELS \
  	OMIT_EH_TABLE EASY_DIV_EXPR IMPLICIT_FIX_EXPR			   \
--- 628,634 ----
  /* Other obsolete target macros, or macros that used to be in target
     headers and were not used, and may be obsolete or may never have
     been used.  */
!  #pragma GCC poison INT_ASM_OP ASM_OUTPUT_EH_REGION_BEG CPP_PREDEFINES	   \
  	ASM_OUTPUT_EH_REGION_END ASM_OUTPUT_LABELREF_AS_INT		   \
  	DOESNT_NEED_UNWINDER EH_TABLE_LOOKUP OBJC_SELECTORS_WITHOUT_LABELS \
  	OMIT_EH_TABLE EASY_DIV_EXPR IMPLICIT_FIX_EXPR			   \
============================================================
Index: gcc/config/freebsd.h
*** gcc/config/freebsd.h	12 Mar 2003 02:29:08 -0000	1.18
--- gcc/config/freebsd.h	17 May 2003 14:33:54 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 41,49 ****
  #undef  WORD_SWITCH_TAKES_ARG
  #define WORD_SWITCH_TAKES_ARG(STR) (FBSD_WORD_SWITCH_TAKES_ARG(STR))
  
- #undef  CPP_PREDEFINES
- /* Obsolete, do not define it. */
- 
  #undef  TARGET_OS_CPP_BUILTINS
  #define TARGET_OS_CPP_BUILTINS() FBSD_TARGET_OS_CPP_BUILTINS()
  
--- 41,46 ----
============================================================
Index: gcc/config/openbsd.h
*** gcc/config/openbsd.h	16 Dec 2002 18:20:43 -0000	1.16
--- gcc/config/openbsd.h	17 May 2003 14:33:54 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 130,138 ****
  
  /* Runtime target specification.  */
  
- /* You must redefine CPP_PREDEFINES in any arch specific file.  */
- #undef CPP_PREDEFINES
- 
  /* Implicit calls to library routines.  */
  
  /* Use memcpy and memset instead of bcopy and bzero.  */
--- 130,135 ----
============================================================
Index: gcc/config/ptx4.h
*** gcc/config/ptx4.h	16 Dec 2002 18:20:43 -0000	1.18
--- gcc/config/ptx4.h	17 May 2003 14:33:55 -0000
*************** Boston, MA 02111-1307, USA.
*** 62,73 ****
    && strcmp (STR, "Tdata") && strcmp (STR, "Ttext")	\
    && strcmp (STR, "Tbss"))
  
- /* You should redefine CPP_PREDEFINES in any file which includes this one.
-    The definition should be appropriate for the type of target system
-    involved, and it should include any -A (assertion) options which are
-    appropriate for the given target system.  */
- #undef CPP_PREDEFINES
- 
  /* Provide an ASM_SPEC appropriate for svr4.  Here we try to support as
     many of the specialized svr4 assembler options as seems reasonable,
     given that there are certain options which we can't (or shouldn't)
--- 62,67 ----
============================================================
Index: gcc/config/svr3.h
*** gcc/config/svr3.h	12 May 2003 09:51:19 -0000	1.18
--- gcc/config/svr3.h	17 May 2003 14:33:55 -0000
*************** Boston, MA 02111-1307, USA.
*** 30,42 ****
  
  	#include "?????.h"
  	#include "svr3.h"
- 
-    followed by any really system-specific defines (or overrides of
-    defines) which you find that you need.  For example, CPP_PREDEFINES
-    is defined here with only the defined -Dunix and -DSVR3.  You should
-    probably override that in your target-specific ?????svr3.h file
-    with a set of defines that includes these, but also contains an
-    appropriate define for the type of hardware that you are targeting.
  */
  
  /* Define a symbol indicating that we are using svr3.h.  */
--- 30,35 ----
*************** Boston, MA 02111-1307, USA.
*** 46,59 ****
     environment and assembler syntax we are targeting for.  */
  #define SVR3_target
  
! /* Cpp, assembler, linker, library, and startfile spec's.  */
! 
! /* You should redefine CPP_PREDEFINES in any file which includes this one.
!    The definition should be appropriate for the type of target system
!    involved, and it should include any -A (assertion) options which are
!    appropriate for the given target system.  */
! 
! #undef CPP_PREDEFINES
  
  /* Output at beginning of assembler file.  */
  /* The .file command should always begin the output.  */
--- 39,45 ----
     environment and assembler syntax we are targeting for.  */
  #define SVR3_target
  
! /* Assembler, linker, library, and startfile spec's.  */
  
  /* Output at beginning of assembler file.  */
  /* The .file command should always begin the output.  */
============================================================
Index: gcc/config/svr4.h
*** gcc/config/svr4.h	16 Dec 2002 18:20:43 -0000	1.28
--- gcc/config/svr4.h	17 May 2003 14:33:55 -0000
*************** Boston, MA 02111-1307, USA.
*** 28,38 ****
     where MACHINE is replaced by the name of the basic hardware that you
     are targeting for.  Then, in the file MACHINE/svr4.h, put any really
     system-specific defines (or overrides of defines) which you find that
!    you need.  For example, CPP_PREDEFINES is defined here with only the
!    defined -Dunix and -DSVR4.  You should probably override that in your
!    target-specific MACHINE/svr4.h file with a set of defines that
!    includes these, but also contains an appropriate define for the type
!    of hardware that you are targeting.
  */
  
  /* Define a symbol indicating that we are using svr4.h.  */
--- 28,34 ----
     where MACHINE is replaced by the name of the basic hardware that you
     are targeting for.  Then, in the file MACHINE/svr4.h, put any really
     system-specific defines (or overrides of defines) which you find that
!    you need.
  */
  
  /* Define a symbol indicating that we are using svr4.h.  */
*************** Boston, MA 02111-1307, USA.
*** 58,69 ****
   (DEFAULT_WORD_SWITCH_TAKES_ARG (STR)			\
    && strcmp (STR, "Tdata") && strcmp (STR, "Ttext")	\
    && strcmp (STR, "Tbss"))
- 
- /* You should redefine CPP_PREDEFINES in any file which includes this one.
-    The definition should be appropriate for the type of target system
-    involved, and it should include any -A (assertion) options which are
-    appropriate for the given target system.  */
- #undef CPP_PREDEFINES
  
  /* Provide an ASM_SPEC appropriate for svr4.  Here we try to support as
     many of the specialized svr4 assembler options as seems reasonable,
--- 54,59 ----
============================================================
Index: gcc/doc/tm.texi
*** gcc/doc/tm.texi	14 May 2003 07:29:54 -0000	1.218
--- gcc/doc/tm.texi	17 May 2003 14:33:58 -0000
*************** variable @code{flag_iso} can be used.  T
*** 650,688 ****
  @code{preprocessing_trad_p()} can be used to check for traditional
  preprocessing.
  
- With @code{TARGET_OS_CPP_BUILTINS} this macro obsoletes the
- @code{CPP_PREDEFINES} target macro.
- 
  @findex TARGET_OS_CPP_BUILTINS
  @item TARGET_OS_CPP_BUILTINS()
  Similarly to @code{TARGET_CPU_CPP_BUILTINS} but this macro is optional
  and is used for the target operating system instead.
- 
- With @code{TARGET_CPU_CPP_BUILTINS} this macro obsoletes the
- @code{CPP_PREDEFINES} target macro.
- 
- @findex CPP_PREDEFINES
- @item CPP_PREDEFINES
- Define this to be a string constant containing @option{-D} options to
- define the predefined macros that identify this machine and system.
- These macros will be predefined unless the @option{-ansi} option (or a
- @option{-std} option for strict ISO C conformance) is specified.
- 
- In addition, a parallel set of macros are predefined, whose names are
- made by appending @samp{__} at the beginning and at the end.  These
- @samp{__} macros are permitted by the ISO standard, so they are
- predefined regardless of whether @option{-ansi} or a @option{-std} option
- is specified.
- 
- For example, on the Sun, one can use the following value:
- 
- @smallexample
- "-Dmc68000 -Dsun -Dunix"
- @end smallexample
- 
- The result is to define the macros @code{__mc68000__}, @code{__sun__}
- and @code{__unix__} unconditionally, and the macros @code{mc68000},
- @code{sun} and @code{unix} provided @option{-ansi} is not specified.
  
  @findex extern int target_flags
  @item extern int target_flags;
--- 650,659 ----


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