This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for builtins.h restructuring [1/2]


On 06/02/2014 01:30 PM, Jeff Law wrote:


* 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...

Ick. Yea, it'd be good if FIRST_PSEUDO_REGISTER doesn't bleed all the way into the front-ends.

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 available.

Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]