This is the mail archive of the
mailing list for the GCC project.
Re: [C++ patch] PR C++/12574
> On Tue, 2003-10-14 at 01:46, Jan Hubicka wrote:
> > Hi,
> > the testcase shows that there is yet another way to reffer to functiona
> > ddress using baselink expression. I am not quite sure I deal with all
> > cases correctly as perhaps I should do something about TEMPLATE_DECL and
> > OVERLOAD too. Mark?
> I think that if this patch is necessary something else is wrong.
> First, the language-specific tree code is BASELINK, not ADDR_EXPR. So,
OK, can BASELINK appear in other context than ADDR_EXPR too, for
instance to represent direct call?
> cxx_callgraph_expr should only have code for BASELINK. Second, if you
> look at cxx_expand_expr, the only way a BASELINK is used is to pull out
> BASELINK_FUNCTIONS. If that's going to work, then BASELINK_FUNCTIONS
> must be a FUNCTION_DECL at that point. So, just do:
> fn = BASELINK_FUNCTIONS (t);
> my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL, ...);
> cgraph_mark_needed_node (cgraph_node (fn));
OK, that would work for my testcase..
> Mark Mitchell <firstname.lastname@example.org>
> CodeSourcery, LLC