[PATCH] D87534: Sema: introduce `__attribute__((__swift_name__))`
Saleem Abdulrasool via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 16 13:47:49 PDT 2020
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);
----------------
compnerd wrote:
> aaron.ballman wrote:
> > compnerd wrote:
> > > 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?
> > Not really, no. The warning diagnostic itself just says that the attribute is ignored, which is the effect but not the rationale. The note (which is easier for folks to ignore) says the attribute is conflicting, but conflicting with *what* (there could be a half dozen attributes on the same declaration, for instance).
> Okay, I don't think that there is an existing warning, but I should be able to add one.
The existing diagnostic is actually more inline with the existing attribute handling for `__attribute__((__optnone__))`, `__attribute__((__minsize__))`, and `__attribute__((__always_inline__))` which merge similarly.
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