[BOLT] Skip warning message if no functions were ignored

Reviewed By: yota9, Amir

Differential Revision: https://reviews.llvm.org/D119673
This commit is contained in:
Maksim Panchenko
2022-02-14 10:31:43 -08:00
parent dd20a459d6
commit 641e92d46b
2 changed files with 5 additions and 3 deletions

View File

@@ -712,8 +712,10 @@ void BinaryContext::skipMarkedFragments() {
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();
}

View File

@@ -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