[clang] [BoundsSafety][NFC] Add counted_by type-shape validation helper (PR #227774)

Yeoul Na via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 14 09:49:24 PDT 2026


================
@@ -710,6 +710,12 @@ class LangOptions : public LangOptionsBase {
     return ConvergentFunctions;
   }
 
+  /// Return true if bounds attributes follow the -fbounds-safety programming
+  /// model. Downstream, which has the full -fbounds-safety implementation, uses
+  /// this predicate to gate behavior that differs from upstream. Remove it once
+  /// that divergence is resolved.
+  bool hasBoundsSafetyAttributes() const { return BoundsSafety; }
----------------
rapidsna wrote:

fwiw, I don't think we should actually upstream attribute-only mode as is. Once all the attributes are available upstream, there's no need "attribute-only" mode. It's currently used as a predicate to gate divergent behavior in downstream. So `hasBoundsSafetyAttributes()` doesn't make a lot of sense in upstream but it's included in this patch to minimize the divergence from downstream.

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


More information about the cfe-commits mailing list