projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
getNewMemBuffer memsets the buffer to zeros,
[oota-llvm.git]
/
lib
/
Support
/
Timer.cpp
diff --git
a/lib/Support/Timer.cpp
b/lib/Support/Timer.cpp
index ea75d45f68a3f75f7a4d8a0e47b83069a2e78c64..210bda754e74957db524630e2b1c18830702a707 100644
(file)
--- a/
lib/Support/Timer.cpp
+++ b/
lib/Support/Timer.cpp
@@
-15,9
+15,11
@@
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/ManagedStatic.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;
#include "llvm/Support/Process.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
@@
-83,14
+85,13
@@
static TimerGroup *getDefaultTimerGroup() {
sys::MemoryFence();
if (tmp) return tmp;
sys::MemoryFence();
if (tmp) return tmp;
-
llvm_acquire_global_lock(
);
+
sys::SmartScopedLock<true> Lock(*TimerLock
);
tmp = DefaultTimerGroup;
if (!tmp) {
tmp = new TimerGroup("Miscellaneous Ungrouped Timers");
sys::MemoryFence();
DefaultTimerGroup = tmp;
}
tmp = DefaultTimerGroup;
if (!tmp) {
tmp = new TimerGroup("Miscellaneous Ungrouped Timers");
sys::MemoryFence();
DefaultTimerGroup = tmp;
}
- llvm_release_global_lock();
return tmp;
}
return tmp;
}
@@
-100,7
+101,7
@@
static TimerGroup *getDefaultTimerGroup() {
//===----------------------------------------------------------------------===//
void Timer::init(StringRef N) {
//===----------------------------------------------------------------------===//
void Timer::init(StringRef N) {
- assert(
TG == 0
&& "Timer already initialized");
+ assert(
!TG
&& "Timer already initialized");
Name.assign(N.begin(), N.end());
Started = false;
TG = getDefaultTimerGroup();
Name.assign(N.begin(), N.end());
Started = false;
TG = getDefaultTimerGroup();
@@
-108,7
+109,7
@@
void Timer::init(StringRef N) {
}
void Timer::init(StringRef N, TimerGroup &tg) {
}
void Timer::init(StringRef N, TimerGroup &tg) {
- assert(
TG == 0
&& "Timer already initialized");
+ assert(
!TG
&& "Timer already initialized");
Name.assign(N.begin(), N.end());
Started = false;
TG = &tg;
Name.assign(N.begin(), N.end());
Started = false;
TG = &tg;