Failure to load a bridging header -> failure to load a module.

This is important for both test targets and for debugging.

rdar://problem/20616099

Swift SVN r30784
This commit is contained in:
Jordan Rose
2015-07-30 00:39:35 +00:00
parent d0b61a8bd7
commit 3028dc8f44
12 changed files with 87 additions and 25 deletions

View File

@@ -1026,10 +1026,15 @@ Status ModuleFile::associateWithFileContext(FileUnit *file,
// The path may be empty if the file being loaded is a partial AST,
// and the current compiler invocation is a merge-modules step.
if (!dependency.RawPath.empty()) {
clangImporter->importHeader(dependency.RawPath, file->getParentModule(),
importedHeaderInfo.fileSize,
importedHeaderInfo.fileModTime,
importedHeaderInfo.contents, diagLoc);
bool hadError =
clangImporter->importHeader(dependency.RawPath,
file->getParentModule(),
importedHeaderInfo.fileSize,
importedHeaderInfo.fileModTime,
importedHeaderInfo.contents,
diagLoc);
if (hadError)
return error(Status::FailedToLoadBridgingHeader);
}
Module *importedHeaderModule = clangImporter->getImportedHeaderModule();
dependency.Import = { {}, importedHeaderModule };