aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Thornburgh <dthorn@google.com>2025-07-22 13:35:46 -0700
committerDaniel Thornburgh <dthorn@google.com>2025-09-02 15:25:07 -0700
commitaaeb8a95da15d411e9cf730cbfa8654273c0b7c1 (patch)
treee2c96f364c1d6ea05e63c5e2c32bedfcb614a6e8
parentf5681b3910c49938e305f9f3564c00a78f2118dc (diff)
downloadllvm-aaeb8a95da15d411e9cf730cbfa8654273c0b7c1.zip
llvm-aaeb8a95da15d411e9cf730cbfa8654273c0b7c1.tar.gz
llvm-aaeb8a95da15d411e9cf730cbfa8654273c0b7c1.tar.bz2
Emit the new type arg from format attr
-rw-r--r--clang/lib/CodeGen/CGCall.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index bf1ddb7..e50ed1c 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -2564,10 +2564,12 @@ void CodeGenModule::ConstructAttributeList(StringRef Name,
if (auto *ModularFormat = TargetDecl->getAttr<ModularFormatAttr>()) {
// TODO: Error checking
FormatAttr *Format = TargetDecl->getAttr<FormatAttr>();
+ StringRef Type = Format->getType()->getName();
std::string FormatIdx = std::to_string(Format->getFormatIdx());
std::string FirstArg = std::to_string(Format->getFirstArg());
SmallVector<StringRef> Args = {
- FormatIdx, FirstArg, ModularFormat->getModularImplFn()->getName(),
+ Type, FormatIdx, FirstArg,
+ ModularFormat->getModularImplFn()->getName(),
ModularFormat->getImplName()};
llvm::append_range(Args, ModularFormat->aspects());
FuncAttrs.addAttribute("modular-format", llvm::join(Args, ","));