This is the mail archive of the gcc@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]

Re: -no-integrated-cpp flag (patches for gcc3.3)


Neil,

The patches are below.  As you requested, I have kept the same name.  I
noticed something unusual that I wanted to bring to your attention.

Apparently, the -traditional-cpp flag with gcc generates and saves the
basename.i file.  I have maintained this behaviour with my patches, but it
seemed unusual to me and it is different from the behaviour of gcc-3.2.


thanks,
ashif.

Patches:
=====================================================================


ChangeLog:

2003-2-26  Ashif Harji  <asharji at uwaterloo dot ca>

	* gcc.c(static struct compiler default_compilers[]): added -no-integrated-cpp flag
               to invoke an external cpp during compilation.
          (struct option_map option_map[]): likewise
	* cp/lang-specs.h(static struct compiler default_compilers[]): added
               -no-integrated-cpp flag to invoke an external cpp during compilation.
	* objc/lang-specs.h(static struct compiler default_compilers[]): added
               -no-integrated-cpp flag to invoke an external cpp during compilation.
	* doc/invoke.texi: Document -no-integrated-cpp flag.


Bootstrapping and Testing:

On i686-pc-linux-gnu:
   - bootstrap was successful
   - no changes in testsuite results when compared to original (gcc-20030224 snapshot)



Patch:

@awk[134]%  diff -c3p gcc-20030224/gcc/gcc.c test/gcc-20030224/gcc/gcc.c
 diff -c3p gcc-20030224/gcc/gcc.c test/gcc-20030224/gcc/gcc.c
*** gcc-20030224/gcc/gcc.c      Thu Dec 12 19:17:19 2002
--- test/gcc-20030224/gcc/gcc.c Fri Feb 28 16:36:27 2003
*************** static const struct compiler default_com
*** 857,867 ****
        %{!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},
    {"-",
     "%{!E:%e-E required when input is from standard input}\
--- 857,867 ----
        %{!E:%{!M:%{!MM:\
            %{traditional|ftraditional:\
  %eGNU C no longer supports -traditional without -E}\
!         %{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
!               %(cpp_options) %{save-temps|traditional-cpp:%b.i} %{!save-temps:%{!traditional-cpp:%g.i}} \n\
!                   cc1 -fpreprocessed %{save-temps|traditional-cpp:%b.i} %{!save-temps:%{!traditional-cpp:%g.i}} %(cc1_options)}\
!         %{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\
!               cc1 %(cpp_unique_options) %(cc1_options)}}}\
          %{!fsyntax-only:%(invoke_as)}}}}", 0},
    {"-",
     "%{!E:%e-E required when input is from standard input}\
*************** static const struct option_map option_ma
*** 965,970 ****
--- 965,971 ----
     {"--library-directory", "-L", "a"},
     {"--machine", "-m", "aj"},
     {"--machine-", "-m", "*j"},
+    {"--no-integrated-cpp", "-no-integrated-cpp", 0},
     {"--no-line-commands", "-P", 0},
     {"--no-precompiled-includes", "-noprecomp", 0},
     {"--no-standard-includes", "-nostdinc", 0},



1>@awk[183]% diff -c3p gcc-20030224/gcc/cp/lang-specs.h  test/gcc-20030224/gcc/cp/lang-specs.h
*** gcc-20030224/gcc/cp/lang-specs.h	Sat Aug 10 16:58:45 2002
--- test/gcc-20030224/gcc/cp/lang-specs.h	Wed Feb 26 12:19:00 2003
*************** Boston, MA 02111-1307, USA.  */
*** 36,45 ****
      "%{E|M|MM:cc1plus -E %{!no-gcc:-D__GNUG__=%v1}\
         %(cpp_options) %2 %(cpp_debug_options)}\
       %{!E:%{!M:%{!MM:\
!        %{save-temps:cc1plus -E %{!no-gcc:-D__GNUG__=%v1}\
! 		%(cpp_options) %2 %b.ii \n}\
!       cc1plus %{save-temps:-fpreprocessed %b.ii}\
! 	      %{!save-temps:%(cpp_unique_options) %{!no-gcc:-D__GNUG__=%v1}}\
  	%(cc1_options) %2 %{+e1*}\
         %{!fsyntax-only:%(invoke_as)}}}}",
       CPLUSPLUS_CPP_SPEC},
--- 36,45 ----
      "%{E|M|MM:cc1plus -E %{!no-gcc:-D__GNUG__=%v1}\
         %(cpp_options) %2 %(cpp_debug_options)}\
       %{!E:%{!M:%{!MM:\
!        %{save-temps|no-integrated-cpp:cc1plus -E %{!no-gcc:-D__GNUG__=%v1}\
! 		%(cpp_options) %2 %{save-temps:%b.ii} %{!save-temps:%g.ii} \n}\
!       cc1plus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.ii} %{!save-temps:%g.ii}}\
! 	      %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options) %{!no-gcc:-D__GNUG__=%v1}}}\
  	%(cc1_options) %2 %{+e1*}\
         %{!fsyntax-only:%(invoke_as)}}}}",
       CPLUSPLUS_CPP_SPEC},


1>@awk[184]% diff -c3p gcc-20030224/gcc/objc/lang-specs.h  test/gcc-20030224/gcc/objc/lang-specs.h
*** gcc-20030224/gcc/objc/lang-specs.h	Sat Aug 10 16:58:45 2002
--- test/gcc-20030224/gcc/objc/lang-specs.h	Wed Feb 26 12:20:21 2003
*************** Boston, MA 02111-1307, USA.  */
*** 30,39 ****
        %{!E:%{!M:%{!MM:\
  	%{traditional|ftraditional|traditional-cpp:\
  %eGNU Objective C no longer supports traditional compilation}\
! 	%{save-temps:cc1obj -E %(cpp_options) %b.mi \n\
! 	    cc1obj -fpreprocessed %b.mi %(cc1_options) %{gen-decls}}\
! 	%{!save-temps:\
! 	    cc1obj %(cpp_unique_options) %(cc1_options) %{gen-decls}}\
          %{!fsyntax-only:%(invoke_as)}}}}", 0},
    {".mi", "@objc-cpp-output", 0},
    {"@objc-cpp-output",
--- 30,39 ----
        %{!E:%{!M:%{!MM:\
  	%{traditional|ftraditional|traditional-cpp:\
  %eGNU Objective C no longer supports traditional compilation}\
! 	%{save-temps|no-integrated-cpp:cc1obj -E %(cpp_options) %{save-temps:%b.mi} %{!save-temps:%g.mi} \n\
! 	    cc1obj -fpreprocessed %{save-temps:%b.mi} %{!save-temps:%g.mi} %(cc1_options) %{gen-decls}}\
! 	%{!save-temps:%{!no-integrated-cpp:\
! 	    cc1obj %(cpp_unique_options) %(cc1_options) %{gen-decls}}}\
          %{!fsyntax-only:%(invoke_as)}}}}", 0},
    {".mi", "@objc-cpp-output", 0},
    {"@objc-cpp-output",


1>@awk[185]% diff -c3p gcc-20030224/gcc/doc/invoke.texi  test/gcc-20030224/gcc/doc/invoke.texi
*** gcc-20030224/gcc/doc/invoke.texi	Sun Feb 23 11:59:31 2003
--- test/gcc-20030224/gcc/doc/invoke.texi	Wed Feb 26 16:25:29 2003
*************** in the following sections.
*** 165,171 ****
  -ansi  -std= at var{standard}  -aux-info @var{filename} @gol
  -fno-asm  -fno-builtin -fno-builtin- at var{function} @gol
  -fhosted  -ffreestanding  -fms-extensions @gol
! -trigraphs  -traditional  -traditional-cpp @gol
  -fallow-single-precision  -fcond-mismatch @gol
  -fsigned-bitfields  -fsigned-char @gol
  -funsigned-bitfields  -funsigned-char @gol
--- 165,171 ----
  -ansi  -std= at var{standard}  -aux-info @var{filename} @gol
  -fno-asm  -fno-builtin -fno-builtin- at var{function} @gol
  -fhosted  -ffreestanding  -fms-extensions @gol
! -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
  -fallow-single-precision  -fcond-mismatch @gol
  -fsigned-bitfields  -fsigned-char @gol
  -funsigned-bitfields  -funsigned-char @gol
*************** Accept some non-standard constructs used
*** 1184,1189 ****
--- 1184,1200 ----
  @opindex trigraphs
  Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
  options for strict ISO C conformance) implies @option{-trigraphs}.
+
+ @item -no-integrated-cpp
+ @opindex no-integrated-cpp
+ Performs a compilation in two passes: preprocessing and compiling.  This
+ option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
+ @option{-B} option. The user supplied compilation step can then add in
+ an additional preprocessing step after normal preprocessing but before
+ compiling. The default is to use the integrated cpp (internal cpp)
+
+ The semantics of this option will change if "cc1", "cc1plus", and
+ "cc1obj" are merged.

  @cindex traditional C language
  @cindex C language, traditional



thanks,
ashif harji


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