summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Timer.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-07 18:33:04 +0000
committerOwen Anderson <resistor@mac.com>2009-07-07 18:33:04 +0000
commit5c96ef7c4e3649ee5119670455d72a320feeb283 (patch)
tree3a1cc20ee28fc1d417ede5313460a8f678ff20b4 /llvm/lib/Support/Timer.cpp
parentf840ed7ed4fcec895377ab86a493f4567580e638 (diff)
downloadbcm5719-llvm-5c96ef7c4e3649ee5119670455d72a320feeb283.tar.gz
bcm5719-llvm-5c96ef7c4e3649ee5119670455d72a320feeb283.zip
Have scoped mutexes take referenes instead of pointers.
llvm-svn: 74931
Diffstat (limited to 'llvm/lib/Support/Timer.cpp')
-rw-r--r--llvm/lib/Support/Timer.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp
index ede1dc96e82..8eef2bd48d8 100644
--- a/llvm/lib/Support/Timer.cpp
+++ b/llvm/lib/Support/Timer.cpp
@@ -145,7 +145,7 @@ static TimeRecord getTimeRecord(bool Start) {
static ManagedStatic<std::vector<Timer*> > ActiveTimers;
void Timer::startTimer() {
- sys::SmartScopedLock<true> L(&Lock);
+ sys::SmartScopedLock<true> L(Lock);
Started = true;
ActiveTimers->push_back(this);
TimeRecord TR = getTimeRecord(true);
@@ -157,7 +157,7 @@ void Timer::startTimer() {
}
void Timer::stopTimer() {
- sys::SmartScopedLock<true> L(&Lock);
+ sys::SmartScopedLock<true> L(Lock);
TimeRecord TR = getTimeRecord(false);
Elapsed += TR.Elapsed;
UserTime += TR.UserTime;
@@ -229,7 +229,7 @@ static ManagedStatic<Name2Timer> NamedTimers;
static ManagedStatic<Name2Pair> NamedGroupedTimers;
static Timer &getNamedRegionTimer(const std::string &Name) {
- sys::SmartScopedLock<true> L(&*TimerLock);
+ sys::SmartScopedLock<true> L(*TimerLock);
Name2Timer::iterator I = NamedTimers->find(Name);
if (I != NamedTimers->end())
return I->second;
@@ -239,7 +239,7 @@ static Timer &getNamedRegionTimer(const std::string &Name) {
static Timer &getNamedRegionTimer(const std::string &Name,
const std::string &GroupName) {
- sys::SmartScopedLock<true> L(&*TimerLock);
+ sys::SmartScopedLock<true> L(*TimerLock);
Name2Pair::iterator I = NamedGroupedTimers->find(GroupName);
if (I == NamedGroupedTimers->end()) {
@@ -365,7 +365,7 @@ llvm::GetLibSupportInfoOutputFile() {
void TimerGroup::removeTimer() {
- sys::SmartScopedLock<true> L(&*TimerLock);
+ sys::SmartScopedLock<true> L(*TimerLock);
if (--NumTimers == 0 && !TimersToPrint.empty()) { // Print timing report...
// Sort the timers in descending order by amount of time taken...
std::sort(TimersToPrint.begin(), TimersToPrint.end(),
@@ -434,12 +434,12 @@ void TimerGroup::removeTimer() {
}
void TimerGroup::addTimer() {
- sys::SmartScopedLock<true> L(&*TimerLock);
+ sys::SmartScopedLock<true> L(*TimerLock);
++NumTimers;
}
void TimerGroup::addTimerToPrint(const Timer &T) {
- sys::SmartScopedLock<true> L(&*TimerLock);
+ sys::SmartScopedLock<true> L(*TimerLock);
TimersToPrint.push_back(Timer(true, T));
}
OpenPOWER on IntegriCloud