Skip to content

Commit 3cb3ce9

Browse files
committed
Guard CacheLogOS behind a condition
1 parent ee39069 commit 3cb3ce9

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
@@ -2027,9 +2027,10 @@ void ThinLTOCodeGenerator::run() {
20272027
WrittenObjects.wait(AllModules);
20282028

20292029
{
2030-
CacheLogOS.applyLocked([&](raw_ostream &OS) {
2031-
OS << "Waiting for outstanding cache requests...\n";
2032-
});
2030+
if (CacheLogging)
2031+
CacheLogOS.applyLocked([&](raw_ostream &OS) {
2032+
OS << "Waiting for outstanding cache requests...\n";
2033+
});
20332034
ScopedDurationTimer T([&](double Seconds) {
20342035
if (CacheLogging)
20352036
CacheLogOS.applyLocked([&](raw_ostream &OS) {

0 commit comments

Comments
 (0)