Timm =?utf-8?q?Bäder?= <tbae...@redhat.com>,
Timm =?utf-8?q?Bäder?= <tbae...@redhat.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/67...@github.com>


================
@@ -5794,6 +5794,30 @@ static void handleRequiresCapabilityAttr(Sema &S, Decl 
*D,
       RequiresCapabilityAttr(S.Context, AL, Args.data(), Args.size());
 
   D->addAttr(RCA);
+
+  if (const auto *FD = dyn_cast<FunctionDecl>(D)) {
+
+    auto collectExprs = [](const FunctionDecl *FuncDecl) {
+      std::set<const ValueDecl*> Args;
+      for (const auto *A : FuncDecl->specific_attrs<RequiresCapabilityAttr>()) 
{
+        for (const Expr *E : A->args()) {
+          if (const auto *DRE = dyn_cast<DeclRefExpr>(E))
+            Args.insert(DRE->getDecl());
----------------
aaronpuchert wrote:

Ideally we'd compare all kinds of expressions, but that's tricky. If we want to 
do it that way, we might indeed be better off doing it via the TIL in 
`ThreadSafety.cpp`.

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

Reply via email to