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] Work harder to find DECL_STRUCT_FUNCTION


On Tue, Oct 7, 2014 at 9:43 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> I wonder if this is worth abstracting into a callee_fn () cgraph edge
>> method?
>
> That would rather be a cgraph node method without "callee" in the name since
> we also apply it to callers, something like:
>
> struct function *cgraph_node::cfun (void)
>
> and the code in can_inline_edge_p would just be:
>
>   struct function *caller_cfun = e->caller->cfun ();
>   struct function *callee_cfun = callee ? callee->cfun () : NULL;

Ah, ok.  Yes agreed - but without the 'c' (nothing is "current" here IMHO).
Maybe ->get_fun () to be consistent with other method names.

I'll pre-approve a patch to do that.

Thanks,
Richard.

> --
> Eric Botcazou


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