On Thu, Apr 21, 2011 at 05:36:42PM +0200, Richard Guenther wrote: > On Thu, Apr 21, 2011 at 5:04 PM, Nathan Froyd <froy...@codesourcery.com> > wrote: > > This patch does two things: > > > > - centralizes some infrastructure for defining builtin function types > > for frontends by providing a common function that > > DEF_FUNCTION_TYPE_FOO macros can call; and > > > > - in order to do that well, it also introduces > > build{,_varargs}_function_type_array for cases when > > build_function_type_list's interface doesn't work so well. > > > > It would have been easier to move all of the builtin-types stuff into > > the middle-end, but Fortran doesn't use builtin-types.def. Even if it > > did, I suppose it's possible that some new front-end could have its own > > set of builtin types, so I'm leaving things as they are. > > But this is what should be done, at least for all builtins in the > BUILT_IN_NORMAL category. ISTR Fortran was once running into > the issue of assigning different DECL_FUNCTION_CODE numbers to > those builtins than other languages, breaking LTO. > > So, it would be indeed nice to have a central middle-end place to > instantiate those builtins and their required types. I'm not sure how > far we are from that and am too lazy to look right now ...
I agree that it would be better to have a central middle-end place for this; I'm not entirely sure why Fortran opts to use a separate set of types; AFAICS, it's a strict subset. Fortran folks...? The question of decls is something different and unrelated to this patch, IMHO. Is the patch OK as-is, or should I work on merging the types into the middle-end in addition? -Nathan