Change SerializedSILLoader::create to return a unique_ptr and use that everywhere so we don't leak SILLoaders.

Swift SVN r15700
This commit is contained in:
Michael Gottesman
2014-03-31 22:57:03 +00:00
parent f1899e185e
commit 4e73547a3e
5 changed files with 11 additions and 14 deletions

View File

@@ -588,7 +588,7 @@ SILVTable *SILModule::lookUpVTable(const ClassDecl *C) {
SerializedSILLoader *SILModule::getSILLoader() {
// If the SILLoader is null, create it.
if (SILLoader.isNull())
if (!SILLoader)
SILLoader = SerializedSILLoader::create(getASTContext(), this,
Callback.get());
// Return the SerializedSILLoader.