From b4aefdeffa7ea98d78d93d92f5411369e8452652 Mon Sep 17 00:00:00 2001 From: Ellis Hoag Date: Thu, 23 Jan 2025 10:17:14 -0800 Subject: [PATCH] [llvm-profdata] Fix detailed summary format on Windows --- llvm/lib/IR/ProfileSummary.cpp | 11 ++++++----- llvm/test/tools/llvm-profdata/general.proftext | 2 -- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/llvm/lib/IR/ProfileSummary.cpp b/llvm/lib/IR/ProfileSummary.cpp index 59f29e5982dfb..12ae81ca8d5f3 100644 --- a/llvm/lib/IR/ProfileSummary.cpp +++ b/llvm/lib/IR/ProfileSummary.cpp @@ -259,10 +259,11 @@ void ProfileSummary::printSummary(raw_ostream &OS) const { void ProfileSummary::printDetailedSummary(raw_ostream &OS) const { OS << "Detailed summary:\n"; for (const auto &Entry : DetailedSummary) { - OS << format("%lu blocks (%.2f%%) with count >= %lu account for %0.6g%% of " - "the total counts.\n", - Entry.NumCounts, - NumCounts ? (100.f * Entry.NumCounts / NumCounts) : 0, - Entry.MinCount, 100.f * Entry.Cutoff / Scale); + OS << Entry.NumCounts << " blocks " + << format("(%.2f%%)", + NumCounts ? (100.f * Entry.NumCounts / NumCounts) : 0) + << " with count >= " << Entry.MinCount << " account for " + << format("%0.6g", 100.f * Entry.Cutoff / Scale) + << "% of the total counts.\n"; } } diff --git a/llvm/test/tools/llvm-profdata/general.proftext b/llvm/test/tools/llvm-profdata/general.proftext index ca532f9a37116..89762f2540f6a 100644 --- a/llvm/test/tools/llvm-profdata/general.proftext +++ b/llvm/test/tools/llvm-profdata/general.proftext @@ -1,5 +1,3 @@ -# FIXME: Somehow this is failing on windows after https://github.com/llvm/llvm-project/pull/105915 -# XFAIL: system-windows # RUN: llvm-profdata merge -sparse=true %s -o %t.profdata # RUN: llvm-profdata merge -sparse=false %s -o %t.profdata.dense