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]

Re: Tree inlining for the C front end (part 1 of 3)


On Wed, Oct 03, 2001 at 03:50:15AM -0300, Alexandre Oliva wrote:
> >> http://gcc.gnu.org/ml/gcc-patches/2001-09/msg01019.html
> > +#define LANG_CANNOT_INLINE_TREE_FN(FNP) \
> > +  (lang_cannot_inline_tree_fn ? (*lang_cannot_inline_tree_fn)(FNP) : 0)
> > +typedef int treeopt_cannot_inline_tree_fn_type PARAMS ((tree*));
> > +extern treeopt_cannot_inline_tree_fn_type *lang_cannot_inline_tree_fn;
> 
> > I do not like these.  If you need hooks, add them to the
> > lang_hooks struct in toplev.c.
> 
> I considered doing this, but it would require anything that uses the
> hooks to have to include tree-inline.h.  Besides, I don't like
> lang_hooks much because the initializers are ordered, not named, which
> may lead to synchronization difficulties and warnings about missing
> initializers, especially for languages maintained outside the GCC CVS
> tree.

Hmm.  Well, a minimum acceptable solution is _not_ to use macros,
but to have e.g. lang_cannot_inline_tree_fn initialized to something
that does what you want as the default.  While this may seem silly
for this example, it isn't for LANG_AUTO_VAR_IN_FN_P.

Fixing lang_hooks to be more like target-def.h would be a nice project...


r~


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