[clang] [clang][TSA] Make RequiresCapability a DeclOrType attribute (PR #67095)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 6 04:58:01 PST 2024


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


================
@@ -8938,6 +8957,11 @@ static void processTypeAttrs(TypeProcessingState &state, QualType &type,
       attr.setUsedAsTypeAttr();
       break;
     }
+    case ParsedAttr::AT_RequiresCapability: {
+      HandleRequiresCapabilityAttr(state, type, attr);
+      attr.setUsedAsTypeAttr();
+      break;
+    }
----------------
AaronBallman wrote:

No, we don't want to modify `FunctionType::ExtInfo`, I think what @erichkeane was talking about is that we added trailing objects to `FunctionProtoType` that we can squirrel lesser-used data into. That might be reasonable here because I cannot imagine anyone using thread safety attributes with K&R C interfaces, but that would be the downside to putting the data on `FunctionProtoType`.

https://github.com/llvm/llvm-project/pull/67095


More information about the cfe-commits mailing list