================
@@ -60,6 +60,40 @@ enum class AllocFnKind : uint64_t {
LLVM_MARK_AS_BITMASK_ENUM(/* LargestValue = */ Aligned)
};
+class DeadOnReturnInfo {
+public:
+ DeadOnReturnInfo() : DeadBytes(std::nullopt) {}
+ DeadOnReturnInfo(uint64_t DeadOnReturnBytes) : DeadBytes(DeadOnReturnBytes)
{}
+
+ uint64_t getNumberOfDeadBytes() const {
+ assert(DeadBytes.has_value() &&
+ "This attribute does not specify a byte count. Did you forget to "
+ "check if the attribute covers all reachable memory?");
+ return DeadBytes.value();
+ }
+
+ bool coversAllReachableMemory() const { return !DeadBytes.has_value(); }
+
+ static DeadOnReturnInfo createFromintValue(uint64_t Data) {
----------------
nikic wrote:
```suggestion
static DeadOnReturnInfo createFromIntValue(uint64_t Data) {
```
https://github.com/llvm/llvm-project/pull/171712
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits