implement support for a new [stdlib] attribute that can be slapped on an import decl.

This causes the SourceLoader to recursively parse the imported module in standard 
library mode, giving it access to the Builtin module.

This is all a terrible hack and should be ripped out with great victory someday, but 
until we have binary modules that persist the build setting used to produce the 
module, this is the best we can do.



Swift SVN r5847
This commit is contained in:
Chris Lattner
2013-06-27 21:31:15 +00:00
parent 5ffcdaea98
commit c03d4454a0
17 changed files with 74 additions and 30 deletions

View File

@@ -559,7 +559,7 @@ Decl *ModuleFile::getDecl(DeclID DID, DeclDeserializationOptions opts) {
Identifier moduleName = getIdentifier(rawAccessPath.front());
rawAccessPath = rawAccessPath.slice(1);
// FIXME: provide a real source location.
Module *M = ctx.getModule(std::make_pair(moduleName, SourceLoc()));
Module *M = ctx.getModule(std::make_pair(moduleName, SourceLoc()), false);
assert(M && "missing dependency");
switch (kind) {
@@ -1051,7 +1051,7 @@ bool ModuleFile::associateWithModule(Module *module) {
assert(!dependency.Mod && "already loaded?");
Identifier ID = ctx.getIdentifier(dependency.Name);
// FIXME: Provide a proper source location.
dependency.Mod = ctx.getModule(std::make_pair(ID, SourceLoc()));
dependency.Mod = ctx.getModule(std::make_pair(ID, SourceLoc()), false);
if (!dependency.Mod)
missingDependency = true;
}