[clang] nolock/noalloc attributes (PR #84983)

Doug Wyatt via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 12 17:20:29 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">;
----------------
dougsonos wrote:

Yeah, the code generating warnings/notes always puts the effect before the function name, so there's consistency there and inconsistency here:
```
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">;
```

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


More information about the cfe-commits mailing list