[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
Tue Jul 8 08:41:03 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:

Is this intended to be specific to _printf_ style format strings? Or will it potentially be reusable for other formatting languages? The text here just says "format string" without saying what kind. For futureproofing, perhaps there should be some kind of a type parameter here saying which formatting mechanism is referred to? That way if two incompatible formatting syntaxes need to be supported later, there's space for expansion.

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


More information about the llvm-branch-commits mailing list