Revert the last patch as it causes a static destruction ordering problem.

llvm-svn: 18925
This commit is contained in:
Reid Spencer 2004-12-14 03:55:21 +00:00
parent 79dc8b79bb
commit 87ad666bb3
1 changed files with 5 additions and 3 deletions

View File

@ -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 {