[clang] [clang] "modular_format" attribute for functions using format strings (PR #147431)

Daniel Thornburgh via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 2 15:35:12 PST 2025


================
@@ -2559,6 +2559,19 @@ void CodeGenModule::ConstructAttributeList(StringRef Name,
 
     if (TargetDecl->hasAttr<ArmLocallyStreamingAttr>())
       FuncAttrs.addAttribute("aarch64_pstate_sm_body");
+
+    if (auto *ModularFormat = TargetDecl->getAttr<ModularFormatAttr>()) {
----------------
mysterymath wrote:

I've made it so that attributes are merged together (trivially, allowing only duplicates), both across multiples per declaration and redeclarations, with the same semantics. That should allow getAttr, right?

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


More information about the cfe-commits mailing list