gkeating 02/12/16 17:11:55
Modified: live/gcc3/gcc gcc.c
Log:
Back out last cpp-precomp change, now on by default
Revision Changes Path
1.159 +55 -28 src/live/gcc3/gcc/gcc.c
Index: gcc.c
===================================================================
RCS file: /cvs/Darwin/src/live/gcc3/gcc/gcc.c,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -r1.158 -r1.159
--- gcc.c 2002/12/10 19:59:49 1.158
+++ gcc.c 2002/12/17 01:11:54 1.159
@@ -1022,39 +1022,46 @@
{".c", "@c", 0},
{"@c",
/* APPLE LOCAL begin cpp-precomp dpatel */
- /* Add support to invoke cpp-precomp, but only when -cpp-precomp is used.
+ /* Add support to invoke cpp-precomp.
+ - Invoke cpp-precomp
+ 1) by default (C and Objective-C).
+ 2) when -cpp-precomp is used.
+ - But do not invoke cpp-precomp when
+ 1) -no-cpp-precomp is used
+ 2) PFE is used
*/
- "%{E|S:%{@:%e-E and -S are not allowed with multiple -arch flags}}\
- %{cpp-precomp|precomp:%{!no-cpp-precomp:%{!M:%{!MM:\
- %{E:%(cpp_precomp) -lang-c %{ansi:-std=c89} %(cpp_precomp_options) \
- %y0}\
- %{!E:\
- %{save-temps:\
- %{!traditional-cpp:\
+ "%{M|MM:%(trad_capable_cpp) %(cpp_options)}\
+ %{E|S:%{@:%e-E and -S are not allowed with multiple -arch flags}}\
+ %{E:\
+ %{traditional|ftraditional|traditional-cpp|no-cpp-precomp:\
+ %(trad_capable_cpp) %(cpp_options)}\
+ %{!traditional:%{!ftraditional:%{!traditional-cpp:%{!no-cpp-precomp:\
+ %(cpp_precomp) -lang-c %{ansi:-std=c89} %(cpp_precomp_options) %y0}}}}}\
+ %{!E:%{!M:%{!MM:\
+ %{save-temps|no-integrated-cpp:\
+ %{no-cpp-precomp|traditional-cpp:%{!fload=*:%{!fdump=*:\
+ %(trad_capable_cpp) %(cpp_options) %b.i \n\
+ cc1 -fpreprocessed %b.i %(cc1_options)}}}\
+ %{cpp-precomp|!no-cpp-precomp|fdump=*|fload=*:%{!traditional-cpp:\
%{<fload=*} %{<fdump=*} \
%(cpp_precomp) -lang-c %{ansi:-std=c89} %(cpp_precomp_options) %y0
%b.i \n\
- cc1 -cpp-precomp %b.i %(cc1_options)}}\
- %{!save-temps:\
- %{!precomp:\
+ cc1 -cpp-precomp %b.i %(cc1_options)}}}\
+ %{!save-temps:%{!no-integrated-cpp:\
+ %{traditional|ftraditional|traditional-cpp:%{!cpp-precomp:\
+ tradcpp0 %(cpp_options) %{!pipe:%g.i} |\n\
+ cc1 -fpreprocessed %{!pipe:%g.i} %(cc1_options)}}}\
+
%{!fdump=*:%{!fload=*:%{!no-cpp-precomp|cpp-precomp:%{!precomp:%{!traditional-cpp:\
%(cpp_precomp) -lang-c %{ansi:-std=c89}\
%(cpp_precomp_options) %y0 %{!pipe:%g.i} |\n\
- cc1 -cpp-precomp %{!pipe:%g.i} %(cc1_options)}\
+ cc1 -cpp-precomp %{!pipe:%g.i} %(cc1_options)}}}}}\
%{precomp:\
%(cpp_precomp) -lang-c %{ansi:-std=c89}\
%(cpp_precomp_options) %y0\
- %{@:-o %f%u.p}%{!@:%W{o}%W{!o*:-o %b-gcc3.p}}}}\
- %{!fsyntax-only:%{!precomp:%(invoke_as)}}}}}}}\
- %{!precomp:%{no-cpp-precomp|!cpp-precomp|M|MM:\
- %{E|M|MM:%(trad_capable_cpp) %(cpp_options) %(cpp_debug_options)}\
- %{!E:%{!M:%{!MM:\
- %{traditional|ftraditional:\
-%eGNU C no longer supports -traditional without -E}\
- %{save-temps|traditional-cpp:%(trad_capable_cpp) \
- %(cpp_options) %b.i \n\
- cc1 -fpreprocessed %b.i %(cc1_options)}\
- %{!save-temps:%{!traditional-cpp:\
- cc1 %(cpp_unique_options) %(cc1_options)}}\
- %{!fsyntax-only:%(invoke_as)}}}}}}", 0},
+ %{@:-o %f%u.p}%{!@:%W{o}%W{!o*:-o %b-gcc3.p}} }\
+ %{!traditional:%{!ftraditional:%{!traditional-cpp:\
+ %{fload=*|fdump=*|no-cpp-precomp:%{!precomp:\
+ cc1 %(cpp_unique_options) %(cc1_options)}}}}}}\
+ %{!fsyntax-only:%{!precomp:%(invoke_as)}}}}}", 0},
/* APPLE LOCAL end cpp-precomp dpatel */
{"-",
"%{!E:%e-E required when input is from standard input}\
@@ -1064,12 +1071,12 @@
/* APPLE LOCAL begin cpp-precomp */
"%{!E:%{!precomp:%ecompilation of header file requested}} \
%{E:%{@:%e-E is not allowed with multiple -arch flags}}\
- %{!precomp:%{!cpp-precomp|no-cpp-precomp:\
+ %{traditional-cpp|no-cpp-precomp:%{!precomp:\
%(trad_capable_cpp) %(cpp_options)}}\
- %{cpp-precomp:%{!traditional-cpp:%{!no-cpp-precomp:\
+ %{!traditional-cpp:%{!no-cpp-precomp:\
%(cpp_precomp) -lang-c %{ansi:-std=c89}\
%(cpp_precomp_options) %y0\
- %{precomp:%{@:-o %f%u.p}%{!@:%W{o}%W{!o*:-o %b-gcc3.p}}} }}}", 0},
+ %{precomp:%{@:-o %f%u.p}%{!@:%W{o}%W{!o*:-o %b-gcc3.p}}} }}", 0},
/* APPLE LOCAL end cpp-precomp */
{".i", "@cpp-output", 0},
{"@cpp-output",
@@ -3343,6 +3350,14 @@
n_infiles = 0;
added_libraries = 0;
+ /* APPLE LOCAL begin cpp-precomp */
+#if !(defined(__APPLE__) && defined(__MACH__))
+ /* If not hosted on Darwin, leave a space for a -no-cpp-precomp
+ later. */
+ n_switches = 1;
+#endif
+ /* APPLE LOCAL end cpp-precomp */
+
/* Figure compiler version from version string. */
compiler_version = temp1 = xstrdup (version_string);
@@ -4112,6 +4127,18 @@
n_switches = 0;
n_infiles = 0;
last_language_n_infiles = -1;
+
+ /* APPLE LOCAL begin cpp-precomp */
+#if !(defined(__APPLE__) && defined(__MACH__))
+ /* If not hosted on Darwin, use the space reserved earlier to insert
+ a -no-cpp-precomp ahead of all other switches. */
+ switches[n_switches].part1 = "no-cpp-precomp";
+ switches[n_switches].args = 0;
+ switches[n_switches].live_cond = SWITCH_OK;
+ switches[n_switches].validated = 0;
+ n_switches++;
+#endif
+ /* APPLE LOCAL end cpp-precomp */
/* This, time, copy the text of each switch and store a pointer
to the copy in the vector of switches.