[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 25 20:45:13 PDT 2024
================
@@ -873,30 +873,17 @@ class Sema final : public SemaBase {
/// Warn when implicitly casting 0 to nullptr.
void diagnoseZeroToNullptrConversion(CastKind Kind, const Expr *E);
- // ----- function effects ---
+ /// All functions/lambdas/blocks which have bodies and which have a non-empty
+ /// FunctionEffectsRef to be verified.
+ SmallVector<const Decl *> DeclsWithEffectsToVerify;
+ /// The union of all effects present on DeclsWithEffectsToVerify. Conditions
+ /// are all null.
+ FunctionEffectSet AllEffectsToVerify;
----------------
Sirraide wrote:
This is used to make sure we don’t try to infer effects that aren’t used anywhere, right? I’m not sure we need this. I’d imagine that most programs will either have no effects at all or none of them, so checking whether we’ve ever seen any effect at all and skipping effect analysis entirely if we have should be enough.
This is especially the case so long as we don’t have a lot of effects. It might make sense to introduce something like this later, but it feels a bit like premature optimisation to me to do this now.
https://github.com/llvm/llvm-project/pull/99656
More information about the cfe-commits
mailing list