This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Convert alpha/ to new CPP builtin macros
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Richard Henderson <rth at redhat dot com>
- Date: Sat, 11 May 2002 17:35:38 +0100
- Subject: Convert alpha/ to new CPP builtin macros
This does the alpha/ directory instead. I'd appreciate it if you
looked over this carefully, Richard. I think everything is the
same, but alpha.h was a bit of a tangle.
Also moves the SJLJ macro to c-common.c from cppinit.c as this
shouldn't be part of libcpp IMO (nor should some of the others,
but we're not able to move them so easily yet).
Tested for reasonableness with a cross compiler to alpha-dec-linux.
OK to apply?
Neil.
* Makefile.in (c-common.o, cppinit.o): Update.
* c-common.c: Include except.h.
(cb_register_builtins): Handle __USING_SJLJ_EXCEPTIONS__.
Call TARGET_CPU_CPP_BUILTINS and TARGET_OS_CPP_BUILTINS.
* cppinit.c (__USING_SJLJ_EXCEPTIONS): Not here.
* defaults.h (TARGET_OS_CPP_BUILTINS, TARGET_CPU_CPP_BUILTINS,
CPP_PREDEFINES): Handle here.
config:
* alpha/alpha-interix.h, alpha/gnu.h, alpha/linux.h,
alpha/netbsd.h, alpha/openbsd.h, alpha/osf.h, alpha/unicosmk.h,
alpha/vms.h, alpha/vxworks.h: Remove CPP_PREDEFINES, define
TARGET_OS_CPP_BUILTINS.
* alpha/alpha.h (TARGET_CPU_CPP_BUILTINS): Define.
(CPP_SPEC, EXTRA_SPECS): Update.
(CPP_AM_BWX_SPEC, CPP_AM_MAX_SPEC, CPP_AM_FIX_SPEC,
CPP_AM_CIX_SPEC, CPP_IM_EV4_SPEC, CPP_IM_EV5_SPEC,
CPP_IM_EV6_SPEC, CPP_CPU_EV4_SPEC, CPP_CPU_EV5_SPEC,
CPP_CPU_EV56_SPEC, CPP_CPU_PCA56_SPEC, CPP_CPU_EV6_SPEC,
CPP_CPU_EV67_SPEC, CPP_CPU_DEFAULT_SPEC, CPP_CPU_SPEC): Remove.
doc:
* tm.texi (TARGET_REGISTER_CPP_BUILTINS): Remove.
(TARGET_OS_CPP_BUILTINS, TARGET_CPU_CPP_BUILTINS): Define.
============================================================
Index: gcc/Makefile.in
--- gcc/Makefile.in 9 May 2002 22:48:31 -0000 1.871
+++ gcc/Makefile.in 11 May 2002 16:26:03 -0000
@@ -1215,7 +1215,7 @@ s-under: $(GCC_PASSES)
c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \
$(C_COMMON_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
$(EXPR_H) $(TM_P_H) builtin-types.def builtin-attrs.def $(TARGET_H) \
- diagnostic.h tree-inline.h
+ diagnostic.h tree-inline.h except.h
# A file used by all variants of C and some other languages.
@@ -2011,7 +2011,7 @@ cpplib.o: cpplib.c $(CONFIG_H) $(LIB
cpphash.o: cpphash.c $(CONFIG_H) $(LIBCPP_DEPS)
cppfiles.o: cppfiles.c $(CONFIG_H) $(LIBCPP_DEPS) $(SPLAY_TREE_H) mkdeps.h
cppinit.o: cppinit.c $(CONFIG_H) $(LIBCPP_DEPS) cppdefault.h \
- mkdeps.h prefix.h version.h except.h
+ mkdeps.h prefix.h version.h
cppdefault.o: cppdefault.c $(CONFIG_H) $(SYSTEM_H) cppdefault.h Makefile
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
============================================================
Index: gcc/c-common.c
--- gcc/c-common.c 9 May 2002 22:48:32 -0000 1.320
+++ gcc/c-common.c 11 May 2002 16:26:12 -0000
@@ -38,6 +38,7 @@ Software Foundation, 59 Temple Place - S
#include "cpplib.h"
#include "target.h"
#include "langhooks.h"
+#include "except.h" /* For USING_SJLJ_EXCEPTIONS. */
cpp_reader *parse_in; /* Declared in c-lex.h. */
#undef WCHAR_TYPE_SIZE
@@ -4325,11 +4326,14 @@ cb_register_builtins (pfile)
cpp_define (pfile, "__GXX_WEAK__=0");
}
+ /* libgcc needs to know this. */
+ if (USING_SJLJ_EXCEPTIONS)
+ cpp_define (pfile, "__USING_SJLJ_EXCEPTIONS__");
+
/* A straightforward target hook doesn't work, because of problems
linking that hook's body when part of non-C front ends. */
-#ifdef TARGET_REGISTER_CPP_BUILTINS
- TARGET_REGISTER_CPP_BUILTINS;
-#endif
+ TARGET_CPU_CPP_BUILTINS ();
+ TARGET_OS_CPP_BUILTINS ();
}
/* Pass an object-like macro. If it doesn't lie in the user's
============================================================
Index: gcc/cppinit.c
--- gcc/cppinit.c 7 May 2002 21:07:14 -0000 1.221
+++ gcc/cppinit.c 11 May 2002 16:26:17 -0000
@@ -663,10 +663,6 @@ static const struct builtin builtin_arra
X("__USER_LABEL_PREFIX__", ULP),
C("__REGISTER_PREFIX__", REGISTER_PREFIX),
C("__HAVE_BUILTIN_SETJMP__", "1"),
-#if USING_SJLJ_EXCEPTIONS
- /* libgcc needs to know this. */
- C("__USING_SJLJ_EXCEPTIONS__","1"),
-#endif
#ifndef NO_BUILTIN_SIZE_TYPE
C("__SIZE_TYPE__", SIZE_TYPE),
#endif
============================================================
Index: gcc/defaults.h
--- gcc/defaults.h 7 May 2002 21:07:15 -0000 1.72
+++ gcc/defaults.h 11 May 2002 16:26:19 -0000
@@ -35,6 +35,18 @@ Software Foundation, 59 Temple Place - S
# 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 assembler-name for a local static variable or function named NAME.
LABELNO is an integer which is different for each call. */
============================================================
Index: gcc/config/alpha/alpha-interix.h
--- gcc/config/alpha/alpha-interix.h 15 Nov 2001 17:55:26 -0000 1.12
+++ gcc/config/alpha/alpha-interix.h 11 May 2002 16:26:19 -0000
@@ -25,15 +25,18 @@ Boston, MA 02111-1307, USA. */
/* cpp handles __STDC__ */
/* The three "Alpha" defines on the first such line are from the CLAXP spec */
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES " \
- -D__INTERIX \
- -D__OPENNT \
- -D__Alpha_AXP -D_M_ALPHA -D_ALPHA_ \
- -D__alpha -D__alpha__\
- -D__stdcall= \
- -D__cdecl= \
- -Asystem=unix -Asystem=interix -Acpu=alpha -Amachine=alpha"
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__INTERIX"); \
+ builtin_define ("__OPENNT"); \
+ builtin_define ("__Alpha_AXP"); \
+ builtin_define ("_M_ALPHA"); \
+ builtin_define ("_ALPHA_"); \
+ builtin_define ("__stdcall="); \
+ builtin_define ("__cdecl="); \
+ builtin_assert ("system=unix"); \
+ builtin_assert ("system=interix"); \
+ } while (0)
#undef CPP_SUBTARGET_SPEC
#define CPP_SUBTARGET_SPEC "\
============================================================
Index: gcc/config/alpha/alpha.h
--- gcc/config/alpha/alpha.h 3 Mar 2002 21:09:47 -0000 1.159
+++ gcc/config/alpha/alpha.h 11 May 2002 16:26:26 -0000
@@ -20,6 +20,50 @@ along with GNU CC; see the file COPYING.
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* Target CPU builtins. */
+#define TARGET_CPU_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__alpha"); \
+ builtin_define ("__alpha__"); \
+ builtin_assert ("cpu=alpha"); \
+ builtin_assert ("machine=alpha"); \
+ if (TARGET_CIX) \
+ { \
+ builtin_define ("__alpha_cix__"); \
+ builtin_assert ("cpu=cix"); \
+ } \
+ if (TARGET_FIX) \
+ { \
+ builtin_define ("__alpha_fix__"); \
+ builtin_assert ("cpu=fix"); \
+ } \
+ if (TARGET_BWX) \
+ { \
+ builtin_define ("__alpha_bwx__"); \
+ builtin_assert ("cpu=bwx"); \
+ } \
+ if (TARGET_MAX) \
+ { \
+ builtin_define ("__alpha_max__"); \
+ builtin_assert ("cpu=max"); \
+ } \
+ if (TARGET_CPU_EV6) \
+ { \
+ builtin_define ("__alpha_ev6__"); \
+ builtin_assert ("cpu=ev6"); \
+ } \
+ else if (TARGET_CPU_EV5) \
+ { \
+ builtin_define ("__alpha_ev5__"); \
+ builtin_assert ("cpu=ev5"); \
+ } \
+ else /* Presumably ev4. */ \
+ { \
+ builtin_define ("__alpha_ev4__"); \
+ builtin_assert ("cpu=ev4"); \
+ } \
+ } while (0)
/* For C++ we need to ensure that __LANGUAGE_C_PLUS_PLUS is defined independent
of the source file extension. */
@@ -37,7 +81,7 @@ Boston, MA 02111-1307, USA. */
%{!.S:%{!.cc:%{!.cxx:%{!.cpp:%{!.cp:%{!.c++:%{!.C:%{!.m:-D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C }}}}}}}}}\
%{mieee:-D_IEEE_FP }\
%{mieee-with-inexact:-D_IEEE_FP -D_IEEE_FP_INEXACT }}\
-%(cpp_cpu) %(cpp_subtarget)"
+%(cpp_subtarget)"
#ifndef CPP_SUBTARGET_SPEC
#define CPP_SUBTARGET_SPEC ""
@@ -285,65 +329,6 @@ extern const char *alpha_mlat_string; /*
N_("Tune expected memory latency")}, \
}
-/* Attempt to describe CPU characteristics to the preprocessor. */
-
-/* Corresponding to amask... */
-#define CPP_AM_BWX_SPEC "-D__alpha_bwx__ -Acpu=bwx"
-#define CPP_AM_MAX_SPEC "-D__alpha_max__ -Acpu=max"
-#define CPP_AM_FIX_SPEC "-D__alpha_fix__ -Acpu=fix"
-#define CPP_AM_CIX_SPEC "-D__alpha_cix__ -Acpu=cix"
-
-/* Corresponding to implver... */
-#define CPP_IM_EV4_SPEC "-D__alpha_ev4__ -Acpu=ev4"
-#define CPP_IM_EV5_SPEC "-D__alpha_ev5__ -Acpu=ev5"
-#define CPP_IM_EV6_SPEC "-D__alpha_ev6__ -Acpu=ev6"
-
-/* Common combinations. */
-#define CPP_CPU_EV4_SPEC "%(cpp_im_ev4)"
-#define CPP_CPU_EV5_SPEC "%(cpp_im_ev5)"
-#define CPP_CPU_EV56_SPEC "%(cpp_im_ev5) %(cpp_am_bwx)"
-#define CPP_CPU_PCA56_SPEC "%(cpp_im_ev5) %(cpp_am_bwx) %(cpp_am_max)"
-#define CPP_CPU_EV6_SPEC \
- "%(cpp_im_ev6) %(cpp_am_bwx) %(cpp_am_max) %(cpp_am_fix)"
-#define CPP_CPU_EV67_SPEC \
- "%(cpp_im_ev6) %(cpp_am_bwx) %(cpp_am_max) %(cpp_am_fix) %(cpp_am_cix)"
-
-#ifndef CPP_CPU_DEFAULT_SPEC
-# if TARGET_CPU_DEFAULT & MASK_CPU_EV6
-# if TARGET_CPU_DEFAULT & MASK_CIX
-# define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV67_SPEC
-# else
-# define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV6_SPEC
-# endif
-# else
-# if TARGET_CPU_DEFAULT & MASK_CPU_EV5
-# if TARGET_CPU_DEFAULT & MASK_MAX
-# define CPP_CPU_DEFAULT_SPEC CPP_CPU_PCA56_SPEC
-# else
-# if TARGET_CPU_DEFAULT & MASK_BWX
-# define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV56_SPEC
-# else
-# define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV5_SPEC
-# endif
-# endif
-# else
-# define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV4_SPEC
-# endif
-# endif
-#endif /* CPP_CPU_DEFAULT_SPEC */
-
-#ifndef CPP_CPU_SPEC
-#define CPP_CPU_SPEC "\
-%{!undef:-Acpu=alpha -Amachine=alpha -D__alpha -D__alpha__ \
-%{mcpu=ev4|mcpu=21064:%(cpp_cpu_ev4) }\
-%{mcpu=ev5|mcpu=21164:%(cpp_cpu_ev5) }\
-%{mcpu=ev56|mcpu=21164a:%(cpp_cpu_ev56) }\
-%{mcpu=pca56|mcpu=21164pc|mcpu=21164PC:%(cpp_cpu_pca56) }\
-%{mcpu=ev6|mcpu=21264:%(cpp_cpu_ev6) }\
-%{mcpu=ev67|mcpu=21264a:%(cpp_cpu_ev67) }\
-%{!mcpu*:%(cpp_cpu_default) }}"
-#endif
-
/* This macro defines names of additional specifications to put in the
specs that can be used in various specifications like CC1_SPEC. Its
definition is an initializer with a subgrouping for each command option.
@@ -359,21 +344,6 @@ extern const char *alpha_mlat_string; /*
#endif
#define EXTRA_SPECS \
- { "cpp_am_bwx", CPP_AM_BWX_SPEC }, \
- { "cpp_am_max", CPP_AM_MAX_SPEC }, \
- { "cpp_am_fix", CPP_AM_FIX_SPEC }, \
- { "cpp_am_cix", CPP_AM_CIX_SPEC }, \
- { "cpp_im_ev4", CPP_IM_EV4_SPEC }, \
- { "cpp_im_ev5", CPP_IM_EV5_SPEC }, \
- { "cpp_im_ev6", CPP_IM_EV6_SPEC }, \
- { "cpp_cpu_ev4", CPP_CPU_EV4_SPEC }, \
- { "cpp_cpu_ev5", CPP_CPU_EV5_SPEC }, \
- { "cpp_cpu_ev56", CPP_CPU_EV56_SPEC }, \
- { "cpp_cpu_pca56", CPP_CPU_PCA56_SPEC }, \
- { "cpp_cpu_ev6", CPP_CPU_EV6_SPEC }, \
- { "cpp_cpu_ev67", CPP_CPU_EV67_SPEC }, \
- { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \
- { "cpp_cpu", CPP_CPU_SPEC }, \
{ "cpp_subtarget", CPP_SUBTARGET_SPEC }, \
SUBTARGET_EXTRA_SPECS
============================================================
Index: gcc/config/alpha/gnu.h
--- gcc/config/alpha/gnu.h 16 Apr 2002 01:16:35 -0000 1.2
+++ gcc/config/alpha/gnu.h 11 May 2002 16:26:26 -0000
@@ -3,9 +3,15 @@
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (Alpha GNU)");
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES \
-"-D__GNU__ -D__gnu_hurd__ -Dunix -Asystem=gnu -D_LONGLONG -D__alpha__ -D__ELF__"
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__GNU__"); \
+ builtin_define ("__ELF__"); \
+ builtin_define ("__gnu_hurd__"); \
+ builtin_define ("_LONGLONG"); \
+ builtin_define_std ("unix"); \
+ builtin_assert ("system=gnu"); \
+ } while (0)
#undef ELF_DYNAMIC_LINKER
#define ELF_DYNAMIC_LINKER "/lib/ld.so"
============================================================
Index: gcc/config/alpha/linux.h
--- gcc/config/alpha/linux.h 15 Apr 2002 20:35:07 -0000 1.28
+++ gcc/config/alpha/linux.h 11 May 2002 16:26:27 -0000
@@ -23,9 +23,14 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES \
- "-D__gnu_linux__ -Dlinux -Dunix -Asystem=linux -D_LONGLONG -D__alpha__"
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__gnu_linux__"); \
+ builtin_define ("_LONGLONG"); \
+ builtin_define_std ("linux"); \
+ builtin_define_std ("unix"); \
+ builtin_assert ("system=linux"); \
+ } while (0)
/* The GNU C++ standard library requires that these macros be defined. */
#undef CPLUSPLUS_CPP_SPEC
============================================================
Index: gcc/config/alpha/netbsd.h
--- gcc/config/alpha/netbsd.h 3 May 2002 19:20:21 -0000 1.10
+++ gcc/config/alpha/netbsd.h 11 May 2002 16:26:27 -0000
@@ -22,10 +22,13 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES \
- "-D__NetBSD__ -D_LP64 -Asystem=unix -Asystem=NetBSD"
-
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__NetBSD__"); \
+ builtin_define ("_LP64"); \
+ builtin_assert ("system=unix"); \
+ builtin_assert ("system=NetBSD"); \
+ } while (0)
/* Show that we need a GP when profiling. */
#undef TARGET_PROFILING_NEEDS_GP
============================================================
Index: gcc/config/alpha/openbsd.h
--- gcc/config/alpha/openbsd.h 11 Apr 2002 23:25:54 -0000 1.5
+++ gcc/config/alpha/openbsd.h 11 May 2002 16:26:27 -0000
@@ -39,8 +39,13 @@ Boston, MA 02111-1307, USA. */
"%{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp %{assert*}"
/* run-time target specifications */
-#define CPP_PREDEFINES "-D__unix__ -D__ANSI_COMPAT -Asystem=unix \
--D__OpenBSD__ -D__alpha__ -D__alpha"
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__OpenBSD__"); \
+ builtin_define ("__ANSI_COMPAT"); \
+ builtin_define ("__unix__"); \
+ builtin_assert ("system=unix"); \
+ } while (0)
/* Layout of source language data types. */
============================================================
Index: gcc/config/alpha/osf.h
--- gcc/config/alpha/osf.h 12 Apr 2002 22:25:08 -0000 1.25
+++ gcc/config/alpha/osf.h 11 May 2002 16:26:29 -0000
@@ -32,9 +32,16 @@ Boston, MA 02111-1307, USA. */
/* Names to predefine in the preprocessor for this target machine. */
-#define CPP_PREDEFINES "\
--Dunix -D__osf__ -D_LONGLONG -DSYSTYPE_BSD \
--D_SYSTYPE_BSD -Asystem=unix -Asystem=xpg4"
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define_std ("unix"); \
+ builtin_define_std ("SYSTYPE_BSD"); \
+ builtin_define ("_SYSTYPE_BSD"); \
+ builtin_define ("__osf__"); \
+ builtin_define ("_LONGLONG"); \
+ builtin_assert ("system=unix"); \
+ builtin_assert ("system=xpg4"); \
+ } while (0)
/* Tru64 UNIX V5 requires additional definitions for 16 byte long double
support. Empty by default. */
============================================================
Index: gcc/config/alpha/unicosmk.h
--- gcc/config/alpha/unicosmk.h 3 Mar 2002 21:09:47 -0000 1.8
+++ gcc/config/alpha/unicosmk.h 11 May 2002 16:26:30 -0000
@@ -32,8 +32,20 @@ Boston, MA 02111-1307, USA. */
/* The following defines are necessary for the standard headers to work
correctly. */
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__unix=1 -D_UNICOS=205 -D_CRAY=1 -D_CRAYT3E=1 -D_CRAYMPP=1 -D_CRAYIEEE=1 -D_ADDR64=1 -D_LD64=1 -D__UNICOSMK__ -D__INT_MAX__=9223372036854775807 -D__SHRT_MAX__=2147483647"
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__unix"); \
+ builtin_define ("_UNICOS=205"); \
+ builtin_define ("_CRAY"); \
+ builtin_define ("_CRAYT3E"); \
+ builtin_define ("_CRAYMPP"); \
+ builtin_define ("_CRAYIEEE"); \
+ builtin_define ("_ADDR64"); \
+ builtin_define ("_LD64"); \
+ builtin_define ("__UNICOSMK__"); \
+ builtin_define ("__INT_MAX__=9223372036854775807"); \
+ builtin_define ("__SHRT_MAX__=2147483647") \
+ } while (0)
#define SHORT_TYPE_SIZE 32
============================================================
Index: gcc/config/alpha/vms.h
--- gcc/config/alpha/vms.h 15 Apr 2002 10:53:36 -0000 1.62
+++ gcc/config/alpha/vms.h 11 May 2002 16:26:31 -0000
@@ -29,9 +29,13 @@ Boston, MA 02111-1307, USA. */
#define NO_EXTERNAL_INDIRECT_ADDRESS
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES \
-"-D__ALPHA -Dvms -DVMS -D__vms__ -D__VMS__ -Asystem=vms"
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define_std ("vms"); \
+ builtin_define_std ("VMS"); \
+ builtin_define ("__ALPHA"); \
+ builtin_assert ("system=vms"); \
+ } while (0)
#undef CPP_SUBTARGET_SPEC
#define CPP_SUBTARGET_SPEC "\
============================================================
Index: gcc/config/alpha/vxworks.h
--- gcc/config/alpha/vxworks.h 2 Nov 2000 23:29:08 -0000 1.6
+++ gcc/config/alpha/vxworks.h 11 May 2002 16:26:31 -0000
@@ -26,10 +26,14 @@ Boston, MA 02111-1307, USA. */
%{!mvxsim: %{!mcpu*|mcpu=21064:-DCPU=21064} %{mcpu=21164:-DCPU=21164}} \
%{posix: -D_POSIX_SOURCE}"
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "\
--D__vxworks -D__alpha_vxworks -Asystem=vxworks \
--Asystem=embedded -D_LONGLONG"
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__vxworks"); \
+ builtin_define ("__alpha_vxworks"); \
+ builtin_define ("_LONGLONG"); \
+ builtin_assert ("system=vxworks"); \
+ builtin_assert ("system=embedded"); \
+ } while (0)
/* VxWorks does all the library stuff itself. */
============================================================
Index: gcc/doc/tm.texi
--- gcc/doc/tm.texi 9 May 2002 22:48:36 -0000 1.122
+++ gcc/doc/tm.texi 11 May 2002 16:27:00 -0000
@@ -623,12 +623,15 @@ The macro @code{STANDARD_STARTFILE_PREFI
Here are run-time target specifications.
@table @code
-@findex TARGET_REGISTER_CPP_BUILTINS
-@item TARGET_REGISTER_CPP_BUILTINS
-This macro expands to a block of code that defines target-specific
-built-in preprocessor macros and assertions, using the functions
-@code{builtin_macro}, @code{builtin_macro_std} and
-@code{builtin_assert} declared in @file{c-lex.h}.
+@findex TARGET_CPU_CPP_BUILTINS
+@item TARGET_CPU_CPP_BUILTINS()
+This function-like macro expands to a block of code that defines
+built-in preprocessor macros and assertions for the target cpu, using
+the functions @code{builtin_macro}, @code{builtin_macro_std} and
+@code{builtin_assert} declared in @file{c-lex.h}. When the front end
+calls this macro it provides a trailing semicolon, and since it has
+finished command line option processing your code can use those
+results freely.
@code{builtin_assert} takes a string in the form you pass to the
command-line option @option{-A}, such as @code{cpu=mips}, and creates
@@ -646,7 +649,16 @@ and possibly @code{unix}; passing @code{
@code{__mips__} and possibly @code{_mips}, and passing @code{_ABI64}
defines only @code{_ABI64}.
-This macro obsoletes the @code{CPP_PREDEFINES} target macro.
+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