[llvm-branch-commits] [llvm] [IR] "modular-format" attribute for functions using format strings (PR #147429)

Simon Tatham via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jul 9 01:10:35 PDT 2025


================
@@ -2620,6 +2620,23 @@ For example:
     This attribute indicates that outlining passes should not modify the
     function.
 
+``"modular_format"="<string_idx>,<first_idx_to_check>,<modular_impl_fn>,<impl_name>,<aspects...>"``
----------------
statham-arm wrote:

Thanks.

An afterthought: even printf and _scanf_ are different enough that they'd need separate handling, so I don't even need to postulate a hypothetical format string syntax from some other language's standard library. For example, your check for arguments of actual floating-point type is fine for telling that a printf call doesn't need float formatting, but for a scanf call, you'd need to look for _pointers_ to floating types instead.

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


More information about the llvm-branch-commits mailing list