On 5 October 2012 01:06, Joseph S. Myers <jos...@codesourcery.com> wrote: > On Thu, 4 Oct 2012, Iain Buclaw wrote: > >> The only patches to gcc proper are documentation-related and adding >> the D frontend / libphobos to configure and make files. I would have >> thought that these would typically only be included with the actual >> front-end? > > Looking back at my previous review comments, I suggested that you might > need to split up c-common.[ch] so that certain parts of attribute handling > could be shared with D, because duplicate code copied from elsewhere in > GCC was not an appropriate implementation approach. Have you then > eliminated the duplicate code in some other way that does not involve > splitting up those files so code can be shared? >
Ah, no; thanks for reminding me of this. The code duplicated from c-common.[ch] are the handlers for C __attributes__, however gdc doesn't use all of them because some just don't have a fitting place eg: gnu_inline, artificial. Would the best approach be to move all handle_* functions and any helper functions into a new source file that can be shared between frontends, and define two new frontend hooks, LANG_HOOK_ATTRIBUTE_TABLE and LANG_HOOK_FORMAT_ATTRIBUTE_TABLE ? Regards -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';