Make module loaders owned by the AST context instead of ref-counted.

Also, create the Clang module loader directly rather than indirecting through
a "get constructor" function. It's no longer a valid configuration to not
have a Clang importer.

Swift SVN r16862
This commit is contained in:
Jordan Rose
2014-04-26 00:57:09 +00:00
parent 1dfc037875
commit 0e7bb07b26
9 changed files with 43 additions and 51 deletions

View File

@@ -61,8 +61,10 @@ private:
public:
/// \brief Create a new importer that can load serialized Swift modules
/// into the given ASTContext.
static SerializedModuleLoader *create(ASTContext &ctx) {
return new SerializedModuleLoader(ctx);
static std::unique_ptr<SerializedModuleLoader> create(ASTContext &ctx) {
return std::unique_ptr<SerializedModuleLoader>{
new SerializedModuleLoader(ctx)
};
}
~SerializedModuleLoader();