Commit 0855eab7 by Caroline Tice Committed by Caroline Tice

gcc.c (combine_flag): New global variable, for new driver option.

2004-04-05  Caroline Tice  <ctice@apple.com>

        * gcc.c (combine_flag): New global variable, for new driver option.
        (struct compiler): Add two new fields, to be used when
        combining multiple input files in a single pass (IMA).
        (default_compilers):  Add values for the new fields to all
        compiler entries. Modify the "@c" compiler entry for doing IMA
        properly with "-save-temps" and the "combine" flag.
        (option_map):  Add new driver option, "--combine", to tell driver
        to pass multiple input files to compiler at one time.
        (have_o_argbuf_index): New global variable.
        (store_arg): Modify to assign value to have_o_argbuf_index.
        (struct infile):  Add three new fields, to help with IMA.
        (display_help): Add help for new "combine" option.
        (process_command): Remove local variable have_o; add code to check
        for new "combine" option; remove assignment to combine_inputs.
        (do_spec_1):  Modify to deal with IMA better.
        (main): Make variable 'lang_n_infiles' local to entire function
        rather than to a single block.  Use flag combine_flag to
        determine whether to do IMA or not; Modify loop initializing
        infiles to deal properly with linker files.
        Add code for doing preprocessing in presence of
        IMA with "-save-temps" flag.  Modify "main" loop to handle
        multiple input files, in multiple languages, with or without
        preprocessing,  gracefully.
        * toplev.c (set_src_pwd): Modify to not complain if attempting to
        re-set it to same directory it's previously been set to (avoid
        irritating, meaningless warning messages when doing IMA with
        save-temps).
        * doc/invoke.texi: Add "-combine" to list of Overall Options;
        remove documentation about IMA that is no longer accurate; Add
        documentation explaining what "-combine" does.
        * ada/lang-specs.h: Add initialization values for new fields in
        "struct compiler".
        * cp/lang-specs.h: Likewise.
        * f/lang-specs.h: Likewise.
        * java/lang-specs.h: Likewise.
        * objc/lang-specs.h: Likewise.
        * treelang/lang-specs.h: Likewise.

Fix gcc driver to work properly with IMI.

From-SVN: r80435
parent 26be75db
2004-04-05 Caroline Tice <ctice@apple.com>
* gcc.c (combine_flag): New global variable, for new driver option.
(struct compiler): Add two new fields, to be used when
combining multiple input files in a single pass (IMA).
(default_compilers): Add values for the new fields to all
compiler entries. Modify the "@c" compiler entry for doing IMA
properly with "-save-temps" and the "combine" flag.
(option_map): Add new driver option, "--combine", to tell driver
to pass multiple input files to compiler at one time.
(have_o_argbuf_index): New global variable.
(store_arg): Modify to assign value to have_o_argbuf_index.
(struct infile): Add three new fields, to help with IMA.
(display_help): Add help for new "combine" option.
(process_command): Remove local variable have_o; add code to check
for new "combine" option; remove assignment to combine_inputs.
(do_spec_1): Modify to deal with IMA better.
(main): Make variable 'lang_n_infiles' local to entire function
rather than to a single block. Use flag combine_flag to
determine whether to do IMA or not; Modify loop initializing
infiles to deal properly with linker files.
Add code for doing preprocessing in presence of
IMA with "-save-temps" flag. Modify "main" loop to handle
multiple input files, in multiple languages, with or without
preprocessing, gracefully.
* toplev.c (set_src_pwd): Modify to not complain if attempting to
re-set it to same directory it's previously been set to (avoid
irritating, meaningless warning messages when doing IMA with
save-temps).
* doc/invoke.texi: Add "-combine" to list of Overall Options;
remove documentation about IMA that is no longer accurate; Add
documentation explaining what "-combine" does.
* ada/lang-specs.h: Add initialization values for new fields in
"struct compiler".
* cp/lang-specs.h: Likewise.
* f/lang-specs.h: Likewise.
* java/lang-specs.h: Likewise.
* objc/lang-specs.h: Likewise.
* treelang/lang-specs.h: Likewise.
2004-04-05 David Edelsohn
* config/rs6000/rs6000.c (VTABLE_NAME_P): Add _ZTI to special
......
......@@ -27,8 +27,8 @@
/* This is the contribution to the `default_compilers' array in gcc.c for
GNAT. */
{".ads", "@ada", 0},
{".adb", "@ada", 0},
{".ads", "@ada", 0, 0, 0},
{".adb", "@ada", 0, 0, 0},
{"@ada",
"\
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
......@@ -40,4 +40,4 @@
%{g*} %{O*} %{W*} %{w} %{p} %{pg:-p} %{m*} %{a} %{f*} %{d*}\
%{!S:%{o*:%w%*-gnatO}} \
%i %{S:%W{o*}%{!o*:-o %b.s}} \
%{!gnatc*:%{!gnatz*:%{!gnats*:%(invoke_as)}}}", 0},
%{!gnatc*:%{!gnatz*:%{!gnats*:%(invoke_as)}}}", 0, 0, 0},
......@@ -26,15 +26,15 @@ Boston, MA 02111-1307, USA. */
#define CPLUSPLUS_CPP_SPEC 0
#endif
{".cc", "@c++", 0},
{".cp", "@c++", 0},
{".cxx", "@c++", 0},
{".cpp", "@c++", 0},
{".c++", "@c++", 0},
{".C", "@c++", 0},
{".CPP", "@c++", 0},
{".H", "@c++-header", 0},
{".hh", "@c++-header", 0},
{".cc", "@c++", 0, 0, 0},
{".cp", "@c++", 0, 0, 0},
{".cxx", "@c++", 0, 0, 0},
{".cpp", "@c++", 0, 0, 0},
{".c++", "@c++", 0, 0, 0},
{".C", "@c++", 0, 0, 0},
{".CPP", "@c++", 0, 0, 0},
{".H", "@c++-header", 0, 0, 0},
{".hh", "@c++-header", 0, 0, 0},
{"@c++-header",
"%{E|M|MM:cc1plus -E %(cpp_options) %2 %(cpp_debug_options)}\
%{!E:%{!M:%{!MM:\
......@@ -44,7 +44,7 @@ Boston, MA 02111-1307, USA. */
%{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\
%(cc1_options) %2 %{+e1*}\
-o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}",
CPLUSPLUS_CPP_SPEC},
CPLUSPLUS_CPP_SPEC, 0, 0},
{"@c++",
"%{E|M|MM:cc1plus -E %(cpp_options) %2 %(cpp_debug_options)}\
%{!E:%{!M:%{!MM:\
......@@ -54,9 +54,9 @@ Boston, MA 02111-1307, USA. */
%{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\
%(cc1_options) %2 %{+e1*}\
%{!fsyntax-only:%(invoke_as)}}}}",
CPLUSPLUS_CPP_SPEC},
CPLUSPLUS_CPP_SPEC, 0, 0},
{".ii", "@c++-cpp-output", 0},
{"@c++-cpp-output",
"%{!M:%{!MM:%{!E:\
cc1plus -fpreprocessed %i %(cc1_options) %2 %{+e*}\
%{!fsyntax-only:%(invoke_as)}}}}", 0},
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
......@@ -155,7 +155,7 @@ in the following sections.
@table @emph
@item Overall Options
@xref{Overall Options,,Options Controlling the Kind of Output}.
@gccoptlist{-c -S -E -o @var{file} -pipe -pass-exit-codes @gol
@gccoptlist{-c -S -E -o @var{file} -combine -pipe -pass-exit-codes @gol
-x @var{language} -v -### --help --target-help --version}
@item C Language Options
......@@ -868,10 +868,6 @@ Place output in file @var{file}. This applies regardless to whatever
sort of output is being produced, whether it be an executable file,
an object file, an assembler file or preprocessed C code.
If you specify @option{-o} when compiling more than one input file, or
you are producing an executable file as output, all the source files
on the command line will be compiled at once.
If @option{-o} is not specified, the default is to put an executable file
in @file{a.out}, the object file for @file{@var{source}.@var{suffix}} in
@file{@var{source}.o}, its assembler file in @file{@var{source}.s}, and
......@@ -896,6 +892,21 @@ various stages of compilation. This fails to work on some systems where
the assembler is unable to read from a pipe; but the GNU assembler has
no trouble.
@item -combine
@opindex combine
If you are compiling multiple source files, this option tells the driver
to pass all the source files to the compiler at once (for those
languages for which the compiler can handle this). This will allow
intermodule analysis (IMA) to be performed by the compiler. Currently the only
language for which this is supported is C. If you pass source files for
multiple languages to the driver, using this option, the driver will invoke
the compiler(s) that support IMA once each, passing each compiler all the
source files appropriate for it. For those languages that do not support
IMA this option will be ignored, and the compiler will be invoked once for
each source file in that language. If you use this option in conjunction
with -save-temps, the compiler will generate multiple pre-processed files
(one for each source file), but only one (combined) .o or .s file.
@item --help
@opindex help
Print (on the standard output) a description of the command line options
......
......@@ -25,23 +25,23 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* This is the contribution to the `default_compilers' array in gcc.c for
g77. */
{".F", "@f77-cpp-input", 0},
{".fpp", "@f77-cpp-input", 0},
{".FPP", "@f77-cpp-input", 0},
{".F", "@f77-cpp-input", 0, 0, 0},
{".fpp", "@f77-cpp-input", 0, 0, 0},
{".FPP", "@f77-cpp-input", 0, 0, 0},
{"@f77-cpp-input",
"cc1 -E -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \
%{E|M|MM:%(cpp_debug_options)}\
%{!M:%{!MM:%{!E: -o %|.f |\n\
f771 %|.f %(cc1_options) %{I*} %{!fsyntax-only:%(invoke_as)}}}}", 0},
{".r", "@ratfor", 0},
f771 %|.f %(cc1_options) %{I*} %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
{".r", "@ratfor", 0, 0, 0},
{"@ratfor",
"%{C:%{!E:%eGCC does not support -C without using -E}}\
%{CC:%{!E:%eGCC does not support -CC without using -E}}\
ratfor %{C} %{CC} %{v} %{E:%W{o*}} %{!E: %{!pipe:-o %g.f} %i |\n\
f771 %m.f %(cc1_options) %{I*} %{!fsyntax-only:%(invoke_as)}}", 0},
{".f", "@f77", 0},
{".for", "@f77", 0},
{".FOR", "@f77", 0},
f771 %m.f %(cc1_options) %{I*} %{!fsyntax-only:%(invoke_as)}}", 0, 0, 0},
{".f", "@f77", 0, 0, 0},
{".for", "@f77", 0, 0, 0},
{".FOR", "@f77", 0, 0, 0},
{"@f77",
"%{!M:%{!MM:%{!E:f771 %i %(cc1_options) %{I*}\
%{!fsyntax-only:%(invoke_as)}}}}", 0},
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
......@@ -26,10 +26,10 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
/* This is the contribution to the `default_compilers' array in gcc.c for
Java. */
{".java", "@java" , 0},
{".class", "@java" , 0},
{".zip", "@java" , 0},
{".jar", "@java" , 0},
{".java", "@java" , 0, 0, 0},
{".class", "@java" , 0, 0, 0},
{".zip", "@java" , 0, 0, 0},
{".jar", "@java" , 0, 0, 0},
{"@java",
"%{fjni:%{femit-class-files:%e-fjni and -femit-class-files are incompatible}}\
%{fjni:%{femit-class-file:%e-fjni and -femit-class-file are incompatible}}\
......@@ -37,5 +37,5 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
%{femit-class-files:%{!fsyntax-only:%e-femit-class-file should used along with -fsyntax-only}}\
%{!E:jc1 %i %(jc1) %(cc1_options) %{+e*} %{I*}\
%{MD:-MD_} %{MMD:-MMD_} %{M} %{MM} %{MA} %{MT*} %{MF*}\
%{!fsyntax-only:%(invoke_as)}}", 0},
%{!fsyntax-only:%(invoke_as)}}", 0, 0, 0},
......@@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. */
/* This is the contribution to the `default_compilers' array in gcc.c for
objc. */
{".m", "@objective-c", 0},
{".m", "@objective-c", 0, 0, 0},
{"@objective-c",
"%{E|M|MM:%(trad_capable_cpp)\
-lang-objc %(cpp_options) %(cpp_debug_options)}\
......@@ -33,11 +33,11 @@ Boston, MA 02111-1307, USA. */
cc1obj -fpreprocessed %{save-temps:%b.mi} %{!save-temps:%g.mi} %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}\
%{!save-temps:%{!no-integrated-cpp:\
cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}}\
%{!fsyntax-only:%(invoke_as)}}}}", 0},
{".mi", "@objc-cpp-output", 0},
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
{".mi", "@objc-cpp-output", 0, 0, 0},
{"@objc-cpp-output",
"%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
%{!fsyntax-only:%(invoke_as)}}}}", 0},
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
{"@objective-c-header",
"%{E|M|MM:cc1obj -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}\
%(cpp_options) %(cpp_debug_options)}\
......@@ -51,4 +51,4 @@ Boston, MA 02111-1307, USA. */
%{!save-temps:%{!no-integrated-cpp:\
cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
-o %g.s %{!o*:--output-pch=%i.gch}\
%W{o*:--output-pch=%*}%V}}}}}", 0},
%W{o*:--output-pch=%*}%V}}}}}", 0, 0, 0},
......@@ -1056,7 +1056,12 @@ bool
set_src_pwd (const char *pwd)
{
if (src_pwd)
return false;
{
if (strcmp (src_pwd, pwd) == 0)
return true;
else
return false;
}
src_pwd = xstrdup (pwd);
return true;
......
......@@ -29,10 +29,10 @@ Boston, MA 02111-1307, USA. */
*/
{".tree", "@treelang", NULL},
{".TREE", "@treelang", NULL},
{".tre", "@treelang", NULL},
{".TRE", "@treelang", NULL},
{".tree", "@treelang", NULL, 0, 0},
{".TREE", "@treelang", NULL, 0, 0},
{".tre", "@treelang", NULL, 0, 0},
{".TRE", "@treelang", NULL, 0, 0},
{"@treelang",
"tree1\
%{!Q:-quiet}\
......@@ -59,5 +59,5 @@ Boston, MA 02111-1307, USA. */
%{!c:-o %d%w%u%O}\
%g.s\
%A\n}\
", NULL
", NULL , 0, 0
},
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment