================
@@ -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) {
----------------
wenju-he wrote:

> Protect the globals correctly with a SmartMutex, 

Done.

Updated commit message. It turns out the previous crash is a test issue. But 
the issue in llvm::TimePassesIsEnabled and llvm::TimePassesPerRun writing is 
real and thread sanitizer output is clean after this PR.

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