[all-commits] [llvm/llvm-project] 0ecf56: [Clang] Fix write-to-global TimePassesIsEnabled ra...

Wenju He via All-commits all-commits at lists.llvm.org
Sun May 31 21:07:19 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0ecf562dac85a29f3de1dd598e3ae0ecc34d1240
      https://github.com/llvm/llvm-project/commit/0ecf562dac85a29f3de1dd598e3ae0ecc34d1240
  Author: Wenju He <wenju.he at intel.com>
  Date:   2026-06-01 (Mon, 01 Jun 2026)

  Changed paths:
    M clang/lib/CodeGen/CodeGenAction.cpp

  Log Message:
  -----------
  [Clang] Fix write-to-global TimePassesIsEnabled race condition in BackendConsumer ctor (#200102)

When multiple threads launch multiple clang::CompilerInstance to compile
sources, there is no crash but thread-sanitizer reports race condition
in simultaneously writing to global variables llvm::TimePassesIsEnabled
and llvm::TimePassesPerRun in BackendConsumer constructor.

This PR fixes it using ManagedStatic SmartMutex and SmartScopedLock.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list