[llvm-commits] [llvm] r65616 - /llvm/branches/Apple/Dib/include/llvm/Support/Timer.h

Bill Wendling isanbard at gmail.com
Thu Feb 26 22:09:23 PST 2009


Author: void
Date: Fri Feb 27 00:09:22 2009
New Revision: 65616

URL: http://llvm.org/viewvc/llvm-project?rev=65616&view=rev
Log:
Merge r64874 into Dib.

Modified:
    llvm/branches/Apple/Dib/include/llvm/Support/Timer.h

Modified: llvm/branches/Apple/Dib/include/llvm/Support/Timer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/Support/Timer.h?rev=65616&r1=65615&r2=65616&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/include/llvm/Support/Timer.h (original)
+++ llvm/branches/Apple/Dib/include/llvm/Support/Timer.h Fri Feb 27 00:09:22 2009
@@ -113,14 +113,19 @@
 /// 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();
   }
 };
 





More information about the llvm-commits mailing list