[clang] [APINotes][BoundsSafety] Upstream API notes format for bounds-safety function parameters (PR #186960)

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 19 09:32:13 PDT 2026


================
@@ -338,6 +338,78 @@ inline bool operator!=(const ContextInfo &LHS, const ContextInfo &RHS) {
   return !(LHS == RHS);
 }
 
+class BoundsSafetyInfo {
+public:
+  enum class BoundsSafetyKind {
+    CountedBy = 0,
+    CountedByOrNull,
+    SizedBy,
+    SizedByOrNull,
+    EndedBy,
+  };
+
+private:
+  /// Whether the bounds safety kind has been audited.
+  LLVM_PREFERRED_TYPE(bool)
+  unsigned KindAudited : 1;
----------------
compnerd wrote:

`NoEscapeSpecified` vs `NoEscape` is different - one is saying it is present or not, the next is if present, this is the value. Here, you are saying this thing has been audited, but doesn't say what the thing is.

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


More information about the cfe-commits mailing list