[llvm-commits] CVS: llvm/lib/VMCore/Pass.cpp PassManagerT.h

Chris Lattner sabre at nondot.org
Sat Dec 9 23:41:01 PST 2006



Changes in directory llvm/lib/VMCore:

Pass.cpp updated: 1.76 -> 1.77
PassManagerT.h updated: 1.71 -> 1.72
---
Log message:

fix PR1039: http://llvm.org/PR1039  by making timing info be destroyed by llvm_shutdown, not by
static dtors.


---
Diffs of the changes:  (+5 -4)

 Pass.cpp       |    4 ++--
 PassManagerT.h |    5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)


Index: llvm/lib/VMCore/Pass.cpp
diff -u llvm/lib/VMCore/Pass.cpp:1.76 llvm/lib/VMCore/Pass.cpp:1.77
--- llvm/lib/VMCore/Pass.cpp:1.76	Thu Dec  7 14:04:42 2006
+++ llvm/lib/VMCore/Pass.cpp	Sun Dec 10 01:40:46 2006
@@ -99,8 +99,8 @@
   // Constructed the first time this is called, iff -time-passes is enabled.
   // This guarantees that the object will be constructed before static globals,
   // thus it will be destroyed before them.
-  static TimingInfo TTI;
-  TheTimeInfo = &TTI;
+  static ManagedStatic<TimingInfo> TTI;
+  TheTimeInfo = &*TTI;
 }
 
 void PMDebug::PrintArgumentInformation(const Pass *P) {


Index: llvm/lib/VMCore/PassManagerT.h
diff -u llvm/lib/VMCore/PassManagerT.h:1.71 llvm/lib/VMCore/PassManagerT.h:1.72
--- llvm/lib/VMCore/PassManagerT.h:1.71	Thu Dec  7 14:04:42 2006
+++ llvm/lib/VMCore/PassManagerT.h	Sun Dec 10 01:40:46 2006
@@ -90,9 +90,10 @@
   std::map<Pass*, Timer> TimingData;
   TimerGroup TG;
 
-  // Private ctor, must use 'create' member
-  TimingInfo() : TG("... Pass execution timing report ...") {}
 public:
+  // Use 'create' member to get this.
+  TimingInfo() : TG("... Pass execution timing report ...") {}
+  
   // TimingDtor - Print out information about timing information
   ~TimingInfo() {
     // Delete all of the timers...






More information about the llvm-commits mailing list