On Tue, Mar 18, 2025 at 4:49 PM Antoni Boucher via Gcc <gcc@gcc.gnu.org> wrote: > > Hi. > We're trying to remove the duplication of the attributes code between > the C and libgccjit frontend. > The attached patch shows a draft of this attempt that only supports a > few attributes. > Would that kind of approach be acceptable (I'm not sure since this > includes a c-family file in libgccjit)? > If not, do you have any idea of how we could do this?
I would suggest to try moving to the middle-end and possibly amend the attribute table maintained there by an extra field with a bitfield of languages the attribute should be implemented for (or just move those that should be available everywhere). The LTO "frontend" is another place where we have duplicates (and you could say the LTO "frontend" is really the middle-end variant). Richard. > Thanks.