This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Martin Jambor <mjambor at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 10 Aug 2012 16:57:41 +0200
- Subject: Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function
- References: <20120809142644.GA11133@virgil.arch.suse.de>
> - ada/gcc-interface/utils.c:rest_of_subprog_body_compilation calls
> dump_function which in turns calls dump_function_to_file which calls
> push_cfun. But Ada front end has its idea of the
> current_function_decl and there is no cfun which is an inconsistency
> which makes push_cfun assert fail. I "solved" it by temporarily
> setting current_function_decl to NULL_TREE. It's just dumping and I
> thought that dump_function should be considered middle-end and thus
> middle-end invariants should apply.
If you think that calling dump_function from rest_of_subprog_body_compilation
is a layering violation, I don't have a problem with replacing it with a more
"manual" scheme like the one in c-family/c-gimplify.c:c_genericize, provided
that this yields roughly the same output.
--
Eric Botcazou