Index: llvm/lib/Support/Signposts.cpp =================================================================== --- llvm/lib/Support/Signposts.cpp +++ llvm/lib/Support/Signposts.cpp @@ -14,6 +14,7 @@ #if LLVM_SUPPORT_XCODE_SIGNPOSTS #include "llvm/ADT/DenseMap.h" #include +#include #endif // if LLVM_SUPPORT_XCODE_SIGNPOSTS using namespace llvm; @@ -38,9 +39,11 @@ LogPtrTy SignpostLog; DenseMap Signposts; + std::mutex Mutex; LogTy &getLogger() const { return *SignpostLog; } os_signpost_id_t getSignpostForObject(const void *O) { + std::lock_guard Guard(Mutex); const auto &I = Signposts.find(O); if (I != Signposts.end()) return I->second;