================
@@ -103,6 +103,23 @@ static StringRef ClassifyDiagnostic(QualType VDT) {
   return "mutex";
 }
 
+static unsigned getCapabilityExprFlags(QualType VDT) {
+  unsigned Flags = 0;
+
+  if (const auto *RT = VDT->getAs<RecordType>()) {
+    if (const auto *RD = RT->getDecl())
+      if (RD->hasAttr<ReentrantCapabilityAttr>())
+        Flags |= CapabilityExpr::FlagReentrant;
+  } else if (const auto *TT = VDT->getAs<TypedefType>()) {
+    if (const auto *TD = TT->getDecl())
+      if (TD->hasAttr<ReentrantCapabilityAttr>())
+        Flags |= CapabilityExpr::FlagReentrant;
+  } else if (VDT->isPointerOrReferenceType())
+    return getCapabilityExprFlags(VDT->getPointeeType());
+
+  return Flags;
+}
----------------
aaronpuchert wrote:

I suppose this could be merged with `ClassifyDiagnostic` as we're doing the 
same cases, but maybe I'm missing something?

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

Reply via email to