[cfe-dev] Attributes and redeclarations
Jordan Rose via cfe-dev
cfe-dev at lists.llvm.org
Thu Jul 20 15:28:44 PDT 2017
[re-adding cfe-dev] Ah, maybe we should have been using InheritableAttr all along. Thanks, Erich!
Jordan
> On Jul 20, 2017, at 15:23, Keane, Erich <erich.keane at intel.com> wrote:
>
> I couldn’t find 'swift_wrapper' as an attribute, however you can check out the AST here:
> https://godbolt.org/g/vDnEJm
>
> I did it with 'aligned'. It attaches to the 2nd decl, and gets inherited by the 3rd.
>
> -----Original Message-----
> From: cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] On Behalf Of Jordan Rose via cfe-dev
> Sent: Thursday, July 20, 2017 3:01 PM
> To: cfe-dev at lists.llvm.org
> Subject: [cfe-dev] Attributes and redeclarations
>
> Hi, all. Michael Ilseman and I were working with the Clang AST (for Swift purposes) and wanted to check something about the behavior of attributes and redeclarations: are they supposed to be propagated forward, so that the most recent declaration has all of the attributes? Or copied back onto the canonical declaration? I have a vague memory that this is the case for function declarations, but the case we care about (today) is redeclarations of typedefs, and it doesn't seem to be occurring there.
>
> typedef int WrappedInt;
> typedef int WrappedInt __attribute__((swift_wrapper(struct)));
> typedef int WrappedInt;
>
> Thanks,
> Jordan
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
More information about the cfe-dev
mailing list