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

via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 26 08:56:06 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);
----------------
Sirraide wrote:

> even just the function call overhead

Hmm, it shouldn’t be *that* bad, but also, I haven’t benchmarked it. This is called once per function declaration, so it shouldn’t be too bad, imo. That said, making it inline sounds fine too because it’s fairly short.

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


More information about the cfe-commits mailing list