mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-08 12:21:04 +00:00
allow TimeRegion to take a potentially-null pointer to a
timer for clang. llvm-svn: 64874
This commit is contained in:
parent
3fc2e67140
commit
733259fd3a
@ -113,14 +113,19 @@ private:
|
||||
/// the relevant timer. This makes it easy to time a region of code.
|
||||
///
|
||||
class TimeRegion {
|
||||
Timer &T;
|
||||
Timer *T;
|
||||
TimeRegion(const TimeRegion &); // DO NOT IMPLEMENT
|
||||
public:
|
||||
explicit TimeRegion(Timer &t) : T(t) {
|
||||
T.startTimer();
|
||||
explicit TimeRegion(Timer &t) : T(&t) {
|
||||
T->startTimer();
|
||||
}
|
||||
explicit TimeRegion(Timer *t) : T(t) {
|
||||
if (T)
|
||||
T->startTimer();
|
||||
}
|
||||
~TimeRegion() {
|
||||
T.stopTimer();
|
||||
if (T)
|
||||
T->stopTimer();
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user