[llvm] [llvm][DebugInfo] formatv in DWARFCFIPrinter (PR #191982)

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 02:37:02 PDT 2026


================
@@ -69,32 +69,32 @@ static void printOperand(raw_ostream &OS, const DIDumpOptions &DumpOpts,
     break;
   case CFIProgram::OT_FactoredCodeOffset: // Always Unsigned
     if (P.codeAlign())
-      OS << format(" %" PRId64, Operand * P.codeAlign());
+      OS << formatv(" {0}", Operand * P.codeAlign());
     else
-      OS << format(" %" PRId64 "*code_alignment_factor", Operand);
+      OS << formatv(" {0}*code_alignment_factor", Operand);
     if (Address && P.codeAlign()) {
       *Address += Operand * P.codeAlign();
-      OS << format(" to 0x%" PRIx64, *Address);
+      OS << formatv(" to {0:x+}", *Address);
     }
     break;
   case CFIProgram::OT_SignedFactDataOffset:
     if (P.dataAlign())
-      OS << format(" %" PRId64, int64_t(Operand) * P.dataAlign());
+      OS << formatv(" {0}", int64_t(Operand) * P.dataAlign());
     else
-      OS << format(" %" PRId64 "*data_alignment_factor", int64_t(Operand));
+      OS << formatv(" {0}*data_alignment_factor", int64_t(Operand));
     break;
   case CFIProgram::OT_UnsignedFactDataOffset:
     if (P.dataAlign())
-      OS << format(" %" PRId64, Operand * P.dataAlign());
+      OS << formatv(" {0}", int64_t(Operand * P.dataAlign()));
     else
-      OS << format(" %" PRId64 "*data_alignment_factor", Operand);
+      OS << formatv(" {0}*data_alignment_factor", Operand);
     break;
   case CFIProgram::OT_Register:
     OS << ' ';
     printRegister(OS, DumpOpts, Operand);
     break;
   case CFIProgram::OT_AddressSpace:
-    OS << format(" in addrspace%" PRId64, Operand);
+    OS << formatv(" in addrspace{0}", Operand);
----------------
DavidSpickett wrote:

Feels like there should have been a space before the number, but let's not go changing that now.

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


More information about the llvm-commits mailing list