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

via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 23 12:54:07 PDT 2024


================
@@ -512,6 +512,14 @@ New features
   if class of allocation and deallocation function mismatches.
   `Documentation <https://clang.llvm.org/docs/analyzer/checkers.html#unix-mismatcheddeallocator-c-c>`__.
 
+- Function effects (the ``nonblocking`` and ``nonallocating`` "performance constraint" attributes)
+  are now verified. Functions with the attribute are checked for language constructs which allocate
+  memory or block, such as using exceptions, static local or thread-local variables, or Objective-C
+  methods or properties. Implicit and explicit function calls are also checked. Called functions
+  must either have the required attribute, or have inline implementations which can be themselves
+  verified. The warnings are controlled by ``-Wfunction-effects``, which is now 
+  disabled by default.
----------------
Sirraide wrote:

```suggestion
- Function effects (the ``nonblocking`` and ``nonallocating`` "performance constraint" attributes)
  are now verified.
```

I don’t think our release notes are normally this detailed. I think just this is enough. It would make sense to update this to point to the function effects documentation once that exists, though ;Þ

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


More information about the cfe-commits mailing list