[clang] [clang][sema] Add nonnull attribute to builtin format functions (PR #160988)

Radovan Božić via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 18 05:20:35 PST 2025


bozicrHT wrote:

Hi Aaron, thanks - the discussion was very helpful. I agree with the conclusions.
For this PR, I’ll rework the implementation to:
- switch from emitting `__attribute__((nonnull))` to emitting `_Nonnull`
- introduce `NonNull<NotOptimizing, [0]>` (with `NotOptimizing` as an enum) in `Builtins.td`, and have that form produce `_Nonnull` qualifiers on the specified parameters instead of the optimizing attribute.

If this sounds like the right scope for this PR, I’ll proceed.


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


More information about the cfe-commits mailing list