This is the mail archive of the gcc-patches@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: [PATCH, trunk] Add Save/Explicit option support


On Tue, Jun 10, 2008 at 04:37:23PM -0700, Ian Lance Taylor wrote:
> Michael Meissner <michael.meissner@amd.com> writes:
> 
> > 2008-06-09  Michael Meissner  <michael.meissner@amd.com>
> > 	    Karthik Kumar  <karthikkumar@gmail.com>
> >
> > 	* opth-gen.awk: Add support for a 'Save' flag which says to give
> > 	the port a way to save and preserve selected command line
> > 	options.  Add support for an 'Explicit' flag which says to add an
> > 	additional variable for noting when the switch has been explicitly
> > 	set.  Do not emit the same declaration more than once.
> >
> > 	* optc-gen.awk: If a 'Save' flag is used, create the
> > 	cl_options_save and cl_options_restore to save/restore the
> > 	selected options.
> >
> > 	* doc/options.texi (Save): Document.
> > 	(Explicit): Ditto.
> 
> 
> > +@item Explicit
> > +If the option is a @code{MASK} option, create an additional variable
> > +@var{var}_explicit which is available to hold whether the option was
> > +set explicitly or implicitly via another option.
> 
> What is the type of @var{var}_explicit?  Where does the value get set?

The type is int, and since it is statically allocated, it will be set to zero.

> It seems from the patch that this just creates a new variable which is
> saved and restored by cl_options_{save,restore}.  That doesn't seem
> all that useful by itself.  If that is the functionality we want to
> provide, then how about some new command which adds a variable to the
> list to be saved and restored?  The definition of Explicit seems too
> specific.
> 
> I think it might be generally useful to have some way to know for any
> flag whether it was set explicitly or not.  But that doesn't seem to
> be what your Explicit provides.

Yes, and I removed it from the patch, since it was only to add one word.
Basically there is an additional variable 'target_flags_explicit' that is
created by the mechanism that is used by same ports to know what switches the
user actually used.  On the x86, when we move the ISA options to
ix86_isa_flags, they added an ix86_isa_flags_explicit variable in i386.c.

-- 
Michael Meissner, AMD
90 Central Street, MS 83-29, Boxborough, MA, 01719, USA
michael.meissner@amd.com


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