================ @@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { }; } // namespace +// ============================================================================= + +namespace FXAnalysis { + +enum class DiagnosticID : uint8_t { + None = 0, // sentinel for an empty Diagnostic + Throws, + Catches, + CallsObjC, + AllocatesMemory, + HasStaticLocal, + AccessesThreadLocal, + + // These only apply to callees, where the analysis stops at the Decl + DeclDisallowsInference, + + CallsDeclWithoutEffect, + CallsExprWithoutEffect, +}; + +// Holds an effect diagnosis, potentially for the entire duration of the +// analysis phase, in order to refer to it when explaining why a caller has been +// made unsafe by a callee. +struct Diagnostic { ---------------- dougsonos wrote:
This class is serving as an abstraction to unify the warning when a `nonblocking` (etc) function blocks, vs. the note when a function's caller is attempting to infer it as `nonblocking` and fails because the function blocks. There are many (6?) of these diagnostics that come in pairs, a warning and a note. This `Diagnostic` class represents the exact unsafe construct and has no opinion about whether it needs to be reported as a warning or a note; there's one function that converts it into a regular diagnostic given the context. https://github.com/llvm/llvm-project/pull/99656 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits