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

Saleem Abdulrasool via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 16 08:43:45 PDT 2020


compnerd marked 8 inline comments as done.
compnerd added inline comments.


================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:4289
+    if (Inline->getName() != Name && !Inline->isImplicit()) {
+      Diag(Inline->getLocation(), diag::warn_attribute_ignored) << Inline;
+      Diag(CI.getLoc(), diag::note_conflicting_attribute);
----------------
aaron.ballman wrote:
> I think it would be more helpful if the diagnostic said why the attribute is being ignored (because the arguments don't match).
Does the note below not accomplish that?


================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:5804-5805
+    if (const auto *Method = dyn_cast<ObjCMethodDecl>(D)) {
+      ParamCount = Method->getSelector().getNumArgs();
+      Params = Method->parameters().slice(0, ParamCount);
+    } else {
----------------
aaron.ballman wrote:
> Do you have to worry about functions with `...` variadic parameters and how those impact counts (for either ObjC or regular methods)?
No, they are currently not auto-imported AFAIK.


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