================
@@ -1,50 +1,33 @@
 #include "clang/ExtractAPI/AvailabilityInfo.h"
+#include "clang/AST/ASTContext.h"
 #include "clang/AST/Attr.h"
+#include "clang/Basic/TargetInfo.h"
 #include "llvm/ADT/STLExtras.h"
 
 using namespace clang;
 using namespace extractapi;
 
-AvailabilitySet::AvailabilitySet(const Decl *Decl) {
-  // Collect availability attributes from all redeclrations.
-  for (const auto *RD : Decl->redecls()) {
-    if (const auto *A = RD->getAttr<UnavailableAttr>()) {
-      if (!A->isImplicit()) {
-        this->Availabilities.clear();
-        UnconditionallyUnavailable = true;
-      }
-    }
+AvailabilityInfo::AvailabilityInfo(const Decl *Decl) {
----------------
daniel-grumberg wrote:

I would prefer if this wasn't a constructor but rather a static type method of 
with signature:
```c++
AvailabilityInfo createFromDecl(const Decl *D);
```
that way you don't have to do line 19-21 in that way.

https://github.com/llvm/llvm-project/pull/76823
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to