Skip to content

Commit b0943f2

Browse files
committed
Fix incorrect timer change
1 parent 2d14162 commit b0943f2

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

clang/lib/CodeGen/CodeGenAction.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,8 @@ void BackendConsumer::HandleTranslationUnit(ASTContext &C) {
238238

239239
Gen->HandleTranslationUnit(C);
240240

241-
if (TimerIsEnabled) {
242-
LLVMIRGenerationRefCount -= 1;
243-
if (LLVMIRGenerationRefCount == 0)
244-
LLVMIRGeneration.stopTimer();
245-
}
241+
if (TimerIsEnabled && !--LLVMIRGenerationRefCount)
242+
LLVMIRGeneration.yieldTo(CI.getFrontendTimer());
246243
}
247244

248245
// Silently ignore if we weren't initialized for some reason.

0 commit comments

Comments
 (0)