Move around the logic for handling autoimport of the swift standard

library.  We use the same (somewhat broken heuristics), they are
just implemented in another way.

The major functionality change is that previously, .sil files would
auto import "swift" if they started with a non-sil decl.  Now they
never do.



Swift SVN r5731
This commit is contained in:
Chris Lattner
2013-06-20 23:39:27 +00:00
parent df230cdd7f
commit a5c7c65ee7
5 changed files with 35 additions and 27 deletions

View File

@@ -197,6 +197,11 @@ public:
/// binding is complete.
llvm::StringMap<PrefixOperatorDecl*> PrefixOperators;
/// This keeps track of whether the swift standard library is autoimported
/// already. This is lazily done the first time name binding is performed
/// when there are decls in a module. This doesn't happen for SIL mode.
bool ShouldAutoImportStandardLibrary = true;
TranslationUnit(Identifier Name, Component *Comp, ASTContext &C,
bool IsMainModule, bool IsReplModule)
: Module(DeclContextKind::TranslationUnit, Name, Comp, C) {