Stop leaking memory from Module and FileUnit.

Also, disallow creating Modules and FileUnits on the stack. They must always
live as long as the ASTContext.

<rdar://problem/15596964>

Swift SVN r13671
This commit is contained in:
Jordan Rose
2014-02-08 02:12:57 +00:00
parent 1e3fd1a5b1
commit cbcf17f9bd
11 changed files with 37 additions and 14 deletions

View File

@@ -132,6 +132,8 @@ class SerializedASTFile final : public LoadedFile {
ModuleFile &File;
~SerializedASTFile() = default;
SerializedASTFile(Module &M, ModuleFile &file)
: LoadedFile(FileUnitKind::SerializedAST, M), File(file) {}