Add Module::failedToLoad(), mainly for REPL and debugging purposes.

LLDB asked for this to differentiate between modules loaded successfully and
modules that are correctly found but can't be loaded for some reason.

rdar://problem/19750055

Swift SVN r27041
This commit is contained in:
Jordan Rose
2015-04-06 21:23:57 +00:00
parent f13bffcba3
commit c5e46b524d
4 changed files with 39 additions and 10 deletions

View File

@@ -364,8 +364,11 @@ Module *SerializedModuleLoader::loadModule(SourceLoc importLoc,
auto M = Module::create(moduleID.first, Ctx);
Ctx.LoadedModules[moduleID.first] = M;
(void)loadAST(*M, moduleID.second, std::move(moduleInputBuffer),
std::move(moduleDocInputBuffer), isFramework);
if (!loadAST(*M, moduleID.second, std::move(moduleInputBuffer),
std::move(moduleDocInputBuffer), isFramework)) {
M->setFailedToLoad();
}
return M;
}