X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FSupport%2FTimer.cpp;h=e1a531a0af2531d63b53ae3bf2d47775a3e49c64;hb=52fa0d066a8fb81716713b85841b1aa031dbf8fc;hp=417ac8d6bb4a4f563e9484662dc16e00004284a4;hpb=9be5c8ca6bb5c91cbc23e24d8703a8e140d68397;p=oota-llvm.git diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp index 417ac8d6bb4..e1a531a0af2 100644 --- a/lib/Support/Timer.cpp +++ b/lib/Support/Timer.cpp @@ -18,7 +18,8 @@ #include "llvm/Support/FileSystem.h" #include "llvm/Support/Format.h" #include "llvm/Support/ManagedStatic.h" -#include "llvm/support/MutexGuard.h" +#include "llvm/Support/Mutex.h" +#include "llvm/Support/MutexGuard.h" #include "llvm/Support/Process.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -65,10 +66,10 @@ raw_ostream *llvm::CreateInfoOutputFile() { // each time -stats or -time-passes wants to print output to it. To // compensate for this, the test-suite Makefiles have code to delete the // info output file before running commands which write to it. - std::string Error; - raw_ostream *Result = new raw_fd_ostream( - OutputFilename.c_str(), Error, sys::fs::F_Append | sys::fs::F_Text); - if (Error.empty()) + std::error_code EC; + raw_ostream *Result = new raw_fd_ostream(OutputFilename, EC, + sys::fs::F_Append | sys::fs::F_Text); + if (!EC) return Result; errs() << "Error opening info-output-file '" @@ -84,7 +85,7 @@ static TimerGroup *getDefaultTimerGroup() { sys::MemoryFence(); if (tmp) return tmp; - llvm::MutexGuard Lock(llvm::llvm_get_global_lock()); + sys::SmartScopedLock Lock(*TimerLock); tmp = DefaultTimerGroup; if (!tmp) { tmp = new TimerGroup("Miscellaneous Ungrouped Timers");