[PATCH] D144405: [clang][pp] Handle attributes defined by plugin in __has_attribute

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 28 14:40:42 PST 2023


erichkeane added a comment.

This needs a release note.  Otherwise I just have a preference for the 'is this spelling/syntax combo provided by this attribute' being in the plugin infrastructure.  It DOES make me wonder however, what happens if TWO plugins provide a different 'true' answer for those?



================
Comment at: clang/lib/Basic/Attributes.cpp:40
 
   int res = hasAttributeImpl(Syntax, Name, ScopeName, Target, LangOpts);
   if (res)
----------------
Ah, I see what you've done here.  I guess that is OK on the other patch then.


================
Comment at: clang/lib/Basic/Attributes.cpp:46
+  for (auto &AttrPlugin : getAttributePluginInstances()) {
+    for (auto &S : AttrPlugin->Spellings)
+      if (S.Syntax == Syntax && S.NormalizedFullName == Name)
----------------
I think this should be a property of the AttributePlugin type, where you send it the Syntax/Name and it checks to see if it is provided. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144405



More information about the cfe-commits mailing list