mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Work around a memory leak caught by the LSAN bot.
Fundamentally the problem here is that SILPassManager is creating an IRGenModule without calling finalize() on it under some circumstances. It would be better to fix that instead. rdar://123923517
This commit is contained in:
@@ -1947,6 +1947,9 @@ bool IRGenModule::finalize() {
|
||||
// Finalize clang IR-generation.
|
||||
finalizeClangCodeGen();
|
||||
|
||||
if (DebugInfo)
|
||||
DebugInfo->finalize();
|
||||
|
||||
// If that failed, report failure up and skip the final clean-up.
|
||||
if (!ClangCodeGen->GetModule())
|
||||
return false;
|
||||
@@ -1955,8 +1958,6 @@ bool IRGenModule::finalize() {
|
||||
emitAutolinkInfo();
|
||||
emitGlobalLists();
|
||||
emitUsedConditionals();
|
||||
if (DebugInfo)
|
||||
DebugInfo->finalize();
|
||||
cleanupClangCodeGenMetadata();
|
||||
|
||||
// Clean up DSOLocal & DLLImport attributes, they cannot be applied together.
|
||||
|
||||
Reference in New Issue
Block a user