[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

Doug Wyatt via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 15 15:40:31 PDT 2024


================
@@ -4429,6 +4434,284 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode {
   }
 };
 
+// ------------------------------------------------------------------------------
+
+class Decl;
+class CXXMethodDecl;
+class FunctionTypeEffectsRef;
+class FunctionTypeEffectSet;
+
+/*
+  TODO: Idea about how to move most of the FunctionEffect business out of
+  Type.h, thus removing these forward declarations.
+
+  - Keep FunctionEffect itself here but make it more minimal. Don't define flags
+  or any behaviors, just the Kind and an accessor.
+  - Keep FunctionEffectCondExpr here.
+  - Make FunctionProtoType and ExtProtoInfo use only ArrayRef<FunctionEffect>
+  and ArrayRef<FunctionEffectCondExpr>.
+  - Somewhere in Sema, define ExtFunctionEffect, which holds a FunctionEffect
+    and has all the behavior-related methods.
+  - There too, define the containers. FunctionTypeEffectsRef can have a
+  constructor or factory method that initializes itself from a
+  FunctionProtoType.
+*/
----------------
dougsonos wrote:

This outlines an idea for removing most of the new bits from Type.h and putting them somewhere under Sema where they'd make more sense.

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


More information about the cfe-commits mailing list