================
@@ -338,6 +338,78 @@ inline bool operator!=(const ContextInfo &LHS, const
ContextInfo &RHS) {
return !(LHS == RHS);
}
+class BoundsSafetyInfo {
+public:
+ enum class BoundsSafetyKind {
+ CountedBy,
+ CountedByOrNull,
+ SizedBy,
+ SizedByOrNull,
+ EndedBy,
+ };
+
+private:
+ /// Whether the bounds safety kind has been audited.
+ LLVM_PREFERRED_TYPE(bool)
+ unsigned KindAudited : 1;
+
+ /// The kind of bounds safety for this property. Only valid if the bounds
+ /// safety has been audited.
+ LLVM_PREFERRED_TYPE(BoundsSafetyKind)
+ unsigned Kind : 3;
+
+ /// Whether the pointer indirection level has been specified.
+ LLVM_PREFERRED_TYPE(bool)
+ unsigned LevelAudited : 1;
+
+ /// The pointer indirection level at which the bounds annotation applies.
+ /// Only valid if LevelAudited is set.
+ unsigned Level : 3;
+
+public:
+ std::string ExternalBounds;
----------------
compnerd wrote:
I think that the question is more, is it meant to be mutated during the
lifetime? If so, what are the semantics of that mutation? (does it invalidate
any thing?). As long as there is no state invalidation involved, direct
mutation is fine.
https://github.com/llvm/llvm-project/pull/186960
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits