================
@@ -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;
----------------
flash1729 wrote:
Yes, this was intended in order to follow the existing pattern in `Types.h`,
when a string doesn't require a `specified`/`audited` bitfield and isn't
optional, it's typically left `public` (for example, `ResultType` and
`SwiftReturnOwnership` in `FunctionInfo`). I also tried to align this with the
downstream implementation, which kept it public as well.
Happy to add a getter/setter if you'd prefer a different convention here.
https://github.com/llvm/llvm-project/pull/186960
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits