[clang] nolock/noalloc attributes (PR #84983)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 13 07:09:25 PDT 2024
================
@@ -10778,6 +10778,101 @@ def warn_imp_cast_drops_unaligned : Warning<
"implicit cast from type %0 to type %1 drops __unaligned qualifier">,
InGroup<DiagGroup<"unaligned-qualifier-implicit-cast">>;
+def warn_func_effect_allocates : Warning<
+ "'%0' function '%1' must not allocate or deallocate memory">,
+ InGroup<FunctionEffects>;
+
+def note_func_effect_allocates : Note<
+ "'%1' cannot be inferred '%0' because it allocates/deallocates memory">;
----------------
Sirraide wrote:
Checking again, it seems we have a precedent for putting `%1` before `%0` in e.g. `err_alignas_mismatch`.
One more thing I just remembered though: I don’t think we normally print function names in diagnostics, simply because the diagnostic already points to the function that is the problem, so maybe just ‘%0 function must not...’ and ‘function cannot...’ might be better here, and that’d also solve the 1-before-0 ‘problem’.
https://github.com/llvm/llvm-project/pull/84983
More information about the cfe-commits
mailing list