[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 14 03:43:30 PDT 2024


================
@@ -873,30 +877,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.
+  FunctionEffectKindSet AllEffectsToVerify;
----------------
Endilll wrote:

Yes, grouping implementations in a single `SemaFunctionEffects.cpp` is the right first step if you want to group your functions. Based on that, you can create a new section in `Sema.h`, and put all declarations and data members there.

I'd refrain from a Sema subcomponent at this stage. My understanding of the efforts in this PR is that they are neither a language nor a target, and we don't know yet how it should be handled.

https://github.com/llvm/llvm-project/pull/99656


More information about the cfe-commits mailing list