fix PR1039 by making timing info be destroyed by llvm_shutdown, not by
authorChris Lattner <sabre@nondot.org>
Sun, 10 Dec 2006 07:40:46 +0000 (07:40 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 10 Dec 2006 07:40:46 +0000 (07:40 +0000)
static dtors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32411 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Pass.cpp
lib/VMCore/PassManagerT.h

index c7a80c5556df20cf3fc8408dd9e9aef2e4585085..9283d4071dbadacb33a590fc019f3b8f8909a515 100644 (file)
@@ -99,8 +99,8 @@ void TimingInfo::createTheTimeInfo() {
   // 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 9753596985b79bd5f2e50b201861a72deb8ec233..62a340beb866adaa96f4d85471066b2a65ef46f4 100644 (file)
@@ -90,9 +90,10 @@ class TimingInfo {
   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...