[serialization] Disable swiftdoc loading for the standard library modules.

This is causing crashes in the IDE tests. Filed <rdar://problem/16329990>.

Swift SVN r15075
This commit is contained in:
Jordan Rose
2014-03-14 20:51:19 +00:00
parent 27d31c3672
commit c8d9e94f85

View File

@@ -47,15 +47,17 @@ openModuleFiles(StringRef DirName, StringRef ModuleFilename,
StringRef(Scratch.data(), Scratch.size()), ModuleBuffer))
return Err;
// Try to open the module documentation file. If it does not exist, ignore
// the error. However, pass though all other errors.
Scratch.clear();
llvm::sys::path::append(Scratch, DirName, ModuleDocFilename);
auto Err = llvm::MemoryBuffer::getFile(
StringRef(Scratch.data(), Scratch.size()), ModuleDocBuffer);
if (Err && Err.value() != llvm::errc::no_such_file_or_directory) {
ModuleBuffer.reset(nullptr);
return Err;
if (!ModuleDocFilename.empty()) {
// Try to open the module documentation file. If it does not exist, ignore
// the error. However, pass though all other errors.
Scratch.clear();
llvm::sys::path::append(Scratch, DirName, ModuleDocFilename);
auto Err = llvm::MemoryBuffer::getFile(
StringRef(Scratch.data(), Scratch.size()), ModuleDocBuffer);
if (Err && Err.value() != llvm::errc::no_such_file_or_directory) {
ModuleBuffer.reset(nullptr);
return Err;
}
}
return llvm::error_code();
}
@@ -115,9 +117,10 @@ findModule(ASTContext &ctx, AccessPathElem moduleID,
}
// Search the runtime import path.
// FIXME: Disable doc imports for now...they cause crashes.
isFramework = false;
return openModuleFiles(ctx.SearchPathOpts.RuntimeLibraryImportPath,
moduleFilename.str(), moduleDocFilename.str(),
moduleFilename.str(), {},
moduleBuffer, moduleDocBuffer, scratch);
}