================
@@ -122,8 +122,10 @@ BackendConsumer::BackendConsumer(CompilerInstance &CI, 
BackendAction Action,
       Gen(CreateLLVMCodeGen(CI, InFile, C, CoverageInfo)),
       LinkModules(std::move(LinkModules)), CurLinkModule(CurLinkModule) {
   TimerIsEnabled = CodeGenOpts.TimePasses;
-  llvm::TimePassesIsEnabled = CodeGenOpts.TimePasses;
-  llvm::TimePassesPerRun = CodeGenOpts.TimePassesPerRun;
+  if (CodeGenOpts.TimePasses) {
----------------
AaronBallman wrote:

Rather than move the race condition around, would it make more sense to:

1) Protect the globals correctly with a `SmartMutex`, or
2) use `llvm::call_once` to perform this init

https://github.com/llvm/llvm-project/pull/200102
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to