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

via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 13 23:05:06 PDT 2024


================
@@ -10941,6 +10941,55 @@ def warn_imp_cast_drops_unaligned : Warning<
   InGroup<DiagGroup<"unaligned-qualifier-implicit-cast">>;
 
 // Function effects
+def warn_func_effect_allocates : Warning<
+  "'%0' function must not allocate or deallocate memory">,
+  InGroup<FunctionEffects>;
+def note_func_effect_allocates : Note<
+  "function cannot be inferred '%0' because it allocates/deallocates memory">;
----------------
Sirraide wrote:

I think a bunch of these here should just be combined into a single diagnostic using `%select`, i.e. something like `"function cannot be inferred '%0' because it %select{allocates ...|throws ...|...}1`.

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


More information about the cfe-commits mailing list