This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Work harder to find DECL_STRUCT_FUNCTION
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Tue, 7 Oct 2014 09:51:52 +0200
- Subject: Re: [patch] Work harder to find DECL_STRUCT_FUNCTION
- Authentication-results: sourceware.org; auth=none
- References: <2181135 dot 6JNuHbnjBK at polaris> <CAFiYyc3fH1qo3hSs44udQa-q=ff+6Z2jdV=zj=fV24uCmHtrxw at mail dot gmail dot com> <6763654 dot 8xTuiYsy0l at polaris>
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