This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [incremental] Patch: FYI: save and restore options and params
- From: "Manuel López-Ibáñez" <lopezibanez at gmail dot com>
- To: "Tom Tromey" <tromey at redhat dot com>
- Cc: "Gcc Patch List" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 29 Jul 2008 17:22:43 +0200
- Subject: Re: [incremental] Patch: FYI: save and restore options and params
- References: <m3iqzbooww.fsf@fleche.redhat.com> <6c33472e0803242353p29aac946h1207c37fc44df9ec@mail.gmail.com> <m3skyelw0e.fsf@fleche.redhat.com> <6c33472e0807290817j706b07o82945ab9c7d2a58@mail.gmail.com>
2008/7/29 Manuel López-Ibáñez <lopezibanez@gmail.com>:
> On 25/03/2008, Tom Tromey <tromey@redhat.com> wrote:
>> >>>>> "Manuel" == Manuel López-Ibáñez <lopezibanez@gmail.com> writes:
>>
>> Manuel> When you say "save the default settings", what do you mean
>> Manuel> exactly? The settings given when invoking the server or the
>> Manuel> default settings as given in the *.opt files?
>>
>> They are the same thing. Right now I think you can pass more
>> arguments to "gcc --server", but they are ignored.
>>
>> This code just walks over the variables in the option structure and
>> makes a copy of their values. Then later we restore by copying the
>> values back. This isn't completely satisfying since some options are
>> handled in funny ways; I probably missed an odd case or two.
>>
>
> Well, I think part of this code should go to mainline but not in this form.
>
> First, I don't think there is a real reason for any option to not be
> handled through entries in the *.opt files. It looks like an
> unfinished transition.
>
> Second, the default value given in the *.opt files through Init()
> should be stored in your structure default_values. Then, options
> variables are initialized to some special value UNINITIALIZED.
> Currently we use -1 for this purpose for some of the options. When the
> compiler starts, it reads commandline options, sets variables and then
> for those still uninitialized, sets default values. The incremental
> compiler just needs 1 extra function (reset_options) that sets all
> options to their uninitialized state.
>
Sorry for the out-of-the-blue reply. The above was an email that I
wrote but never sent. Nonetheless, I think the comments are sitll
relevant.
Cheers,
Manuel.