This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: cfun and current_function_decl
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: "Paulo J. Matos" <pocmatos at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 18 Jan 2010 11:30:22 +0100
- Subject: Re: cfun and current_function_decl
- References: <11b141711001180224l48ac6a1bxa3741e153d0bf374@mail.gmail.com>
On Mon, Jan 18, 2010 at 11:24 AM, Paulo J. Matos <pocmatos@gmail.com> wrote:
> Hi,
>
> As a continuation of my previous issue, what's the difference between
> cfun and current_function_decl and which one should I use to walk the
> tree during TARGET_FUNCTION_OK_FOR_SIBCALL?
>
> [In the internals document I only found references to cfun and even
> there was hard to understand what it actually is]
It's supposed to be that cfun->decl == current_function_decl. Use
cfun in the middle-end, current_function_decl is used by frontends
as long as there is no struct function allocated for a function.
Richard.