Skip to content

Commit 7fbd0e7

Browse files
committed
Guard CacheLogOS behind a condition
1 parent e71e40b commit 7fbd0e7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/LTO/ThinLTOCodeGenerator.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,9 +2024,10 @@ void ThinLTOCodeGenerator::run() {
20242024
WrittenObjects.wait(AllModules);
20252025

20262026
{
2027-
CacheLogOS.applyLocked([&](raw_ostream &OS) {
2028-
OS << "Waiting for outstanding cache requests...\n";
2029-
});
2027+
if (CacheLogging)
2028+
CacheLogOS.applyLocked([&](raw_ostream &OS) {
2029+
OS << "Waiting for outstanding cache requests...\n";
2030+
});
20302031
ScopedDurationTimer T([&](double Seconds) {
20312032
if (CacheLogging)
20322033
CacheLogOS.applyLocked([&](raw_ostream &OS) {

0 commit comments

Comments
 (0)