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] Implement -fcallgraph-info option


On Fri, 29 Oct 2010, Eric Botcazou wrote:

> > Please use Variable declarations in common.opt for new option variables,
> > so they go in the gcc_options structure, instead of manual declarations in
> > flags.h and toplev.c.
> 
> flag_stack_usage_info isn't associated with any option though.  As for the 
> other one, where should I put the defines then?

The defines can stay in flags.h.

The aim is for common_handle_option (and all target option handlers) to 
cease to set any global state.  Everything it sets should end up either 
being set through the opts pointer passed to the function, or being set in 
subsequent code after the main option handling.  If a variable is closely 
related to option state, and could reasonably exist in both the driver and 
the core compilers, then it's appropriate for it to go in the gcc_options 
structure using a Variable declaration, whether or not it directly 
describes the state of a single option.  I think that applies to 
flag_stack_usage_info.

-- 
Joseph S. Myers
joseph@codesourcery.com


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