Introduce "SourceFile" within a TranslationUnit.

Right now this is just an extra layer of indirection for the decls,
operators, and imports in a TU, but it's the first step towards compiling
multiple source files at once without pretending they're all in a single
file. This is important for the "implicit visibility" feature, where
declarations from other source files in the same module are accessible
from the file currently being compiled.

Swift SVN r9072
This commit is contained in:
Jordan Rose
2013-10-09 18:38:15 +00:00
parent 37bb48afb0
commit 597640a5d2
18 changed files with 168 additions and 105 deletions

View File

@@ -121,7 +121,7 @@ Module *SourceLoader::loadModule(SourceLoc importLoc,
auto *importTU = new (Ctx) TranslationUnit(moduleID.first, comp, Ctx,
TranslationUnit::Library);
Ctx.LoadedModules[moduleID.first.str()] = importTU;
importTU->setImportBufferID(bufferID);
importTU->MainSourceFile->setImportBufferID(bufferID);
performAutoImport(importTU);