diff --git a/llvm/lib/IR/PassTimingInfo.cpp b/llvm/lib/IR/PassTimingInfo.cpp --- a/llvm/lib/IR/PassTimingInfo.cpp +++ b/llvm/lib/IR/PassTimingInfo.cpp @@ -22,7 +22,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/FormatVariadic.h" -#include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Mutex.h" #include "llvm/Support/TypeName.h" #include "llvm/Support/raw_ostream.h" @@ -92,8 +91,6 @@ Timer *newPassTimer(StringRef PassID, StringRef PassDesc); }; -static ManagedStatic> TimingInfoMutex; - PassTimingInfo::PassTimingInfo() : TG("pass", "... Pass execution timing report ...") {} @@ -110,8 +107,8 @@ // Constructed the first time this is called, iff -time-passes is enabled. // This guarantees that the object will be constructed after static globals, // thus it will be destroyed before them. - static ManagedStatic TTI; - TheTimeInfo = &*TTI; + static PassTimingInfo TTI; + TheTimeInfo = &TTI; } /// Prints out timing information and then resets the timers. @@ -133,7 +130,8 @@ return nullptr; init(); - sys::SmartScopedLock Lock(*TimingInfoMutex); + static sys::SmartMutex TimingInfoMutex; + sys::SmartScopedLock Lock(TimingInfoMutex); std::unique_ptr &T = TimingData[Pass]; if (!T) {