Use a list of module loaders instead of a single Clang importer.

This paves the way for having a Swift module importer. The eventual goal
here is to eliminate all explicit uses of the Clang module loader, but
I'm not going to push too hard on that for now.

Swift SVN r5092
This commit is contained in:
Jordan Rose
2013-05-08 18:09:33 +00:00
parent 22859a119b
commit ccae995f61
10 changed files with 291 additions and 166 deletions

View File

@@ -234,7 +234,8 @@ ArrayRef<ExtensionDecl*> Module::lookupExtensions(Type T) {
return Cache.getExtensions(T->getCanonicalType());
}
return Ctx.getModuleLoader().lookupExtensions(cast<ClangModule>(this), T);
assert(isa<ClangModule>(this));
return Ctx.getClangModuleLoader()->lookupExtensions(this, T);
}
//===----------------------------------------------------------------------===//
@@ -260,8 +261,9 @@ void Module::lookupValue(AccessPathTy AccessPath, Identifier Name,
.lookupValue(AccessPath, Name, LookupKind, *TU, Result);
}
return Ctx.getModuleLoader().lookupValue(cast<ClangModule>(this), AccessPath,
Name, LookupKind, Result);
assert(isa<ClangModule>(this));
return Ctx.getClangModuleLoader()->lookupValue(this, AccessPath,
Name, LookupKind, Result);
}
/// lookupVisibleDecls - Find ValueDecls in the module and pass them to the