diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-12-14 03:55:21 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-12-14 03:55:21 +0000 |
commit | 87ad666bb3ff77191d97ef7b7eb65d034e3bede8 (patch) | |
tree | 71819d0952a4d21a74cc87cce0733edb26cd1850 /llvm/lib | |
parent | 79dc8b79bb3318d772db9e81fb3698c350c51d1c (diff) | |
download | bcm5719-llvm-87ad666bb3ff77191d97ef7b7eb65d034e3bede8.tar.gz bcm5719-llvm-87ad666bb3ff77191d97ef7b7eb65d034e3bede8.zip |
Revert the last patch as it causes a static destruction ordering problem.
llvm-svn: 18925
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Support/Timer.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp index 4b88be2b094..ff3fd6fefe0 100644 --- a/llvm/lib/Support/Timer.cpp +++ b/llvm/lib/Support/Timer.cpp @@ -33,10 +33,12 @@ namespace llvm { extern std::ostream *GetLibSupportInfoOutputFile(); } // problem is that a Statistic<> object gets destroyed, which ends up calling // 'GetLibSupportInfoOutputFile()' (below), which calls this function. // LibSupportInfoOutputFilename used to be a global variable, but sometimes it -// would get destroyed before the Statistic, causing havoc to ensue. +// would get destroyed before the Statistic, causing havoc to ensue. We "fix" +// this by creating the string the first time it is needed and never destroying +// it. static std::string &getLibSupportInfoOutputFilename() { - static std::string LibSupportInfoOutputFilename; - return LibSupportInfoOutputFilename; + static std::string *LibSupportInfoOutputFilename = new std::string(); + return *LibSupportInfoOutputFilename; } namespace { |