mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Change ASTContext's LoadedModules map to be keyed by Identifiers, not strings.
No intended functionality change, but there's no reason to be performing string lookups here. Swift SVN r20902
This commit is contained in:
@@ -201,7 +201,7 @@ void CompilerInstance::performSema() {
|
||||
const SourceFileKind Kind = Invocation.getInputKind();
|
||||
Identifier ID = Context->getIdentifier(Invocation.getModuleName());
|
||||
MainModule = Module::create(ID, *Context);
|
||||
Context->LoadedModules[ID.str()] = MainModule;
|
||||
Context->LoadedModules[ID] = MainModule;
|
||||
|
||||
auto modImpKind = SourceFile::ImplicitModuleImportKind::Stdlib;
|
||||
|
||||
@@ -399,7 +399,7 @@ void CompilerInstance::performParseOnly() {
|
||||
const SourceFileKind Kind = Invocation.getInputKind();
|
||||
Identifier ID = Context->getIdentifier(Invocation.getModuleName());
|
||||
MainModule = Module::create(ID, *Context);
|
||||
Context->LoadedModules[ID.str()] = MainModule;
|
||||
Context->LoadedModules[ID] = MainModule;
|
||||
|
||||
assert(Kind == SourceFileKind::Main || Kind == SourceFileKind::Library);
|
||||
assert(BufferIDs.size() == 1 && "only supports parsing a single file");
|
||||
|
||||
Reference in New Issue
Block a user