[PATCH] D87534: Sema: introduce `__attribute__((__swift_name__))`

Doug Gregor via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 14 09:29:29 PDT 2020


doug.gregor added a comment.

Thank you for doing this!



================
Comment at: clang/include/clang/Basic/Attr.td:2173
+      SubjectList<[Enum, EnumConstant, Field, Function, GlobalVar, Struct, TypedefName,
+                   ObjCInterface, ObjCClassMethod, ObjCInstanceMethod, ObjCProperty, ObjCProtocol],
+      ErrorDiag, "ExpectedSwiftNameSubjects">;
----------------
compnerd wrote:
> Note for @rjmccall and @doug.gregor - this version actually enumerates the subjects to which this attribute appertains unlike what was in the original swift version.  Are there other subjects which this should list?
Hmm. If we enumerate the subjects, we're going to have to update Clang whenever Swift's Clang importer learns a new trick. For example, this is probably missing CXXMethod and FunctionTmpl based on work that's going on in Swift. I suspect we're also missing ObjCCompatibilityAlias. I'm inclined to treat this more like AsmLabelAttr and not try to enumerate subjects at all.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87534/new/

https://reviews.llvm.org/D87534



More information about the cfe-commits mailing list