<rdar://problem/12125274>

Intentionally leak the module list to avoid unnecessary freeing of modules + object files + symbol files when the program is exiting.

llvm-svn: 164184
This commit is contained in:
Greg Clayton 2012-09-18 23:50:22 +00:00
parent dfa424c593
commit 6f4d8af713
1 changed files with 8 additions and 2 deletions

View File

@ -643,8 +643,14 @@ ModuleList::GetIndexForModule (const Module *module) const
static ModuleList &
GetSharedModuleList ()
{
static ModuleList g_shared_module_list;
return g_shared_module_list;
// NOTE: Intentionally leak the module list so a program doesn't have to
// cleanup all modules and object files as it exits. This just wastes time
// doing a bunch of cleanup that isn't required.
static ModuleList *g_shared_module_list = NULL;
if (g_shared_module_list == NULL)
g_shared_module_list = new ModuleList(); // <--- Intentional leak!!!
return *g_shared_module_list;
}
bool