diff --git a/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp b/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp index e442b5182f6a4..d37e75d46551c 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp @@ -32,7 +32,7 @@ static raw_ostream &operator<<(raw_ostream &OS, const Atom &A) { StringRef Str = dwarf::AtomTypeString(A.Value); if (!Str.empty()) return OS << Str; - return OS << "DW_ATOM_unknown_" << format("%x", A.Value); + return OS << "DW_ATOM_unknown_" << formatv("{0:x-}", A.Value); } } // namespace @@ -185,7 +185,7 @@ bool AppleAcceleratorTable::dumpName(ScopedPrinter &W, return false; // End of list DictScope NameScope(W, ("Name@0x" + Twine::utohexstr(NameOffset)).str()); - W.startLine() << format("String: 0x%08" PRIx64, StringOffset); + W.startLine() << formatv("String: {0:x8}", StringOffset); W.getOStream() << " \"" << StringSection.getCStr(&StringOffset) << "\"\n"; unsigned NumData = AccelSection.getU32(DataOffset); @@ -193,7 +193,7 @@ bool AppleAcceleratorTable::dumpName(ScopedPrinter &W, ListScope DataScope(W, ("Data " + Twine(Data)).str()); unsigned i = 0; for (auto &Atom : AtomForms) { - W.startLine() << format("Atom[%d]: ", i); + W.startLine() << formatv("Atom[{0}]: ", i); if (Atom.extractValue(AccelSection, DataOffset, FormParams)) { Atom.dump(W.getOStream()); if (std::optional Val = Atom.getAsUnsignedConstant()) { @@ -859,7 +859,7 @@ void DWARFDebugNames::NameIndex::dumpName(ScopedPrinter &W, if (Hash) W.printHex("Hash", *Hash); - W.startLine() << format("String: 0x%08" PRIx64, NTE.getStringOffset()); + W.startLine() << formatv("String: {0:x8}", NTE.getStringOffset()); W.getOStream() << " \"" << NTE.getString() << "\"\n"; uint64_t EntryOffset = NTE.getEntryOffset(); @@ -870,7 +870,7 @@ void DWARFDebugNames::NameIndex::dumpName(ScopedPrinter &W, void DWARFDebugNames::NameIndex::dumpCUs(ScopedPrinter &W) const { ListScope CUScope(W, "Compilation Unit offsets"); for (uint32_t CU = 0; CU < Hdr.CompUnitCount; ++CU) - W.startLine() << format("CU[%u]: 0x%08" PRIx64 "\n", CU, getCUOffset(CU)); + W.startLine() << formatv("CU[{0}]: {1:x8}\n", CU, getCUOffset(CU)); } void DWARFDebugNames::NameIndex::dumpLocalTUs(ScopedPrinter &W) const { @@ -879,8 +879,8 @@ void DWARFDebugNames::NameIndex::dumpLocalTUs(ScopedPrinter &W) const { ListScope TUScope(W, "Local Type Unit offsets"); for (uint32_t TU = 0; TU < Hdr.LocalTypeUnitCount; ++TU) - W.startLine() << format("LocalTU[%u]: 0x%08" PRIx64 "\n", TU, - getLocalTUOffset(TU)); + W.startLine() << formatv("LocalTU[{0}]: {1:x8}\n", TU, + getLocalTUOffset(TU)); } void DWARFDebugNames::NameIndex::dumpForeignTUs(ScopedPrinter &W) const { @@ -889,8 +889,8 @@ void DWARFDebugNames::NameIndex::dumpForeignTUs(ScopedPrinter &W) const { ListScope TUScope(W, "Foreign Type Unit signatures"); for (uint32_t TU = 0; TU < Hdr.ForeignTypeUnitCount; ++TU) { - W.startLine() << format("ForeignTU[%u]: 0x%016" PRIx64 "\n", TU, - getForeignTUSignature(TU)); + W.startLine() << formatv("ForeignTU[{0}]: {1:x16}\n", TU, + getForeignTUSignature(TU)); } }