[PATCH] D119673: [BOLT] Skip warning message if no functions were ignored
Maksim Panchenko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 13 11:07:44 PST 2022
maksfb created this revision.
maksfb added reviewers: yota9, rafauler, Amir, ayermolo.
maksfb requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D119673
Files:
bolt/lib/Core/BinaryContext.cpp
bolt/test/X86/split-func-icf.s
Index: bolt/test/X86/split-func-icf.s
===================================================================
--- bolt/test/X86/split-func-icf.s
+++ bolt/test/X86/split-func-icf.s
@@ -16,7 +16,7 @@
# CHECK-DAG: BOLT-WARNING: Ignoring main2
# CHECK-DAG: BOLT-WARNING: Ignoring main
# CHECK-DAG: BOLT-WARNING: Ignoring main2.cold.1(*2)
-# CHECK: BOLT-WARNING: Ignored 3 functions due to cold fragments.
+# CHECK: BOLT-WARNING: ignored 3 functions due to cold fragments
.text
.globl main
.type main, %function
Index: bolt/lib/Core/BinaryContext.cpp
===================================================================
--- bolt/lib/Core/BinaryContext.cpp
+++ bolt/lib/Core/BinaryContext.cpp
@@ -712,8 +712,10 @@
std::for_each(BF->ParentFragments.begin(), BF->ParentFragments.end(),
addToWorklist);
}
- errs() << "BOLT-WARNING: Ignored " << FragmentsToSkip.size() << " functions "
- << "due to cold fragments.\n";
+ if (!FragmentsToSkip.empty())
+ errs() << "BOLT-WARNING: ignored " << FragmentsToSkip.size() << " function"
+ << (FragmentsToSkip.size() == 1 ? "" : "s")
+ << " due to cold fragments\n";
FragmentsToSkip.clear();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119673.408282.patch
Type: text/x-patch
Size: 1198 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220213/eb0e1ee4/attachment.bin>
More information about the llvm-commits
mailing list