This is the mail archive of the
mailing list for the GCC project.
Re: Patch for builtins.h restructuring [1/2]
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: Jeff Law <law at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 02 Jun 2014 14:42:30 -0400
- Subject: Re: Patch for builtins.h restructuring [1/2]
- Authentication-results: sourceware.org; auth=none
- References: <538C9790 dot 2070006 at redhat dot com> <538CB4D0 dot 3070108 at redhat dot com>
On 06/02/2014 01:30 PM, Jeff Law wrote:
Ick. Yea, it'd be good if FIRST_PSEUDO_REGISTER doesn't bleed all the
way into the front-ends.
* Finally, fortran/trans.c was calling fold_builtin_call_array directly.
That means it would have needed builtins.h which caused issues since
builtins.h defines struct target_builtins and uses
FIRST_PSEUDO_REGISTER... which is defined within the target config
file... something I dont think we really want to expose to the fortran
front end :-P. Anyway, looking aorund, it turns out
fold-const.c::fold_build_call_array_loc is really a wrapper for a call
to fold_builtin_call_array, with some extra checking code before and
after the call protected by ENABLE_FOLD_CHECKING. I'd think that should
be OK since its what other front ends call...
I in fact tried to remove that from builtins.h since the structure is
only used in builtins.[ch] and target-globals.[ch], but it was not
easily possible.. target-globals.c has a struct target_globals_extra
which uses a copy of struct target_builtins, along with half a dozen
others, and thus needs to see the declaration. All the other references
simply use a pointer to the structure.
maybe at some point we could hide that with something more generic for
all those structs.. All we likely need is to export a few routines like
target_builtins_alloc () and target_builtins_copy (p)... and maybe a
target_builtins_free ()... for each kind of structure... I wasnt about
to do anything like that when it turned out to be something simpler