diff options
author | Chris Lattner <sabre@nondot.org> | 2006-12-10 07:40:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-12-10 07:40:46 +0000 |
commit | ad796fadf7014739b96f28c8d4d9533a759b2cb7 (patch) | |
tree | a26d95b6f4c84faadff5afb6c63d4bf7f8b0a837 | |
parent | bef61c57811da498f9c29d0b5a813811c36bffed (diff) | |
download | bcm5719-llvm-ad796fadf7014739b96f28c8d4d9533a759b2cb7.tar.gz bcm5719-llvm-ad796fadf7014739b96f28c8d4d9533a759b2cb7.zip |
fix PR1039 by making timing info be destroyed by llvm_shutdown, not by
static dtors.
llvm-svn: 32411
-rw-r--r-- | llvm/lib/VMCore/Pass.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/VMCore/PassManagerT.h | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/VMCore/Pass.cpp b/llvm/lib/VMCore/Pass.cpp index c7a80c5556d..9283d4071db 100644 --- a/llvm/lib/VMCore/Pass.cpp +++ b/llvm/lib/VMCore/Pass.cpp @@ -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) { diff --git a/llvm/lib/VMCore/PassManagerT.h b/llvm/lib/VMCore/PassManagerT.h index 9753596985b..62a340beb86 100644 --- a/llvm/lib/VMCore/PassManagerT.h +++ b/llvm/lib/VMCore/PassManagerT.h @@ -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... |