On Tue, Oct 7, 2014 at 9:43 AM, Eric Botcazou <ebotca...@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