diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp --- a/bolt/lib/Core/BinaryContext.cpp +++ b/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(); } diff --git a/bolt/test/X86/split-func-icf.s b/bolt/test/X86/split-func-icf.s --- a/bolt/test/X86/split-func-icf.s +++ b/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