mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -386,7 +386,7 @@ void Serializer::writeInputFiles(const TranslationUnit *TU,
|
||||
SourceFile.emit(ScratchRecord, path);
|
||||
}
|
||||
|
||||
for (auto import : TU->getImports()) {
|
||||
for (auto import : TU->MainSourceFile->getImports()) {
|
||||
if (import.first.second == TU->Ctx.TheBuiltinModule)
|
||||
continue;
|
||||
|
||||
@@ -1924,7 +1924,7 @@ void Serializer::writeTranslationUnit(const TranslationUnit *TU, const SILModule
|
||||
writeSILFunctions(M);
|
||||
|
||||
DeclTable topLevelDecls, extensionDecls, operatorDecls;
|
||||
for (auto D : TU->Decls) {
|
||||
for (auto D : TU->MainSourceFile->Decls) {
|
||||
if (isa<ImportDecl>(D))
|
||||
continue;
|
||||
else if (auto VD = dyn_cast<ValueDecl>(D)) {
|
||||
|
||||
Reference in New Issue
Block a user