This is the mail archive of the
mailing list for the GCC project.
[PATCH]: Clean up driver processing for IMA
- From: Caroline Tice <ctice at apple dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Caroline Tice <ctice at apple dot com>
- Date: Mon, 22 Mar 2004 15:48:44 -0800
- Subject: [PATCH]: Clean up driver processing for IMA
This patch cleans up the way the gcc driver passes multiple input files
to the compiler. In particular, it
adds a new flag "combine". When this flag is passed to the compiler
driver, the driver attempts to pass
(for example) all the *.c files to the cc1 compiler together, allowing
for IMA . This patch also fixes the
driver so that "-save-temps" works properly with "-combine", and so
that "-combine" can also handle
linker files and source files for multiple languages (for example if
you pass it a combination of c and
c++ files, it will attempt to pass all the c files to cc1 at once, but
will pass the c++ files individually to
cc1plus, then pass the appropriate options to the assembler/linker). I
have currently not modified the c++ or objective-c compiler specs to
cope with multiple source files at once.
I have tested this on an Apple G4 running apple-darwin, and an i386
running Linux. It has bootstrapped
and I am in the middle of running the DejaGnu tests. (I also tested
various combinations of the
"-combine" "-save-temps" "-S" and "-c" flags on a multiple file C
Assuming it passes all the tests is this ok to commit to gcc 3.5?
-- Caroline Tice
2004-03-22 Caroline Tice <firstname.lastname@example.org>
* gcc.c (combine_flag): New global variable, for new driver
(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
properly with "-save-temps" and the "combine" flag.
(option_map): Add new driver option, "--combine", to tell
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
for new "combine" option; remove assignment to
(do_spec_1): Modify to deal with IMA better.
(main): Make variable 'lang_n_infiles' local to entire
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
* toplev.c (set_src_pwd): Modify to not complain if
re-set it to same directory it's previously been set to
irritating, meaningless warning messages when doing IMA with
* cp/lang-specs.h: Add initialization values for new fields
* objc/lang-specs.h: Likewise.
Description: Text document