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

Doug Wyatt via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 26 08:49:16 PDT 2024


================
@@ -15609,6 +15661,10 @@ Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Decl *D,
       getCurLexicalContext()->getDeclKind() != Decl::ObjCImplementation)
     Diag(FD->getLocation(), diag::warn_function_def_in_objc_container);
 
+  if (Context.hasAnyFunctionEffects())
+    if (const auto FX = FD->getFunctionEffects(); !FX.empty())
+      maybeAddDeclWithEffects(FD, FX);
----------------
dougsonos wrote:

Not sure if you saw the performance PR where `hasAnyFunctionEffects()` was introduced but it's left me a little paranoid about even just the function call overhead. Possibly a good compromise would be to make `maybeAddDeclWithEffects` inline.

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


More information about the cfe-commits mailing list