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

[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 program).

Assuming it passes all the tests is this ok to commit to gcc 3.5?

-- Caroline Tice

2004-03-22 Caroline Tice <>

* 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
* cp/lang-specs.h: Add initialization values for new fields in
"struct compiler".
* objc/lang-specs.h: Likewise.

Attachment: gcc5-imi3.txt
Description: Text document

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