[Frontend] Allow missing files when allowing compiler errors

As with other compilation errors, we want to generate the swiftmodule
regardless.
This commit is contained in:
Ben Barham
2021-02-23 15:29:13 +10:00
parent 0d9ca2044f
commit bb9dd3a4aa
3 changed files with 31 additions and 2 deletions

View File

@@ -655,7 +655,7 @@ CompilerInstance::getRecordedBufferID(const InputFile &input,
// Recover by dummy buffer if requested.
if (!buffers.hasValue() && shouldRecover &&
input.getType() == file_types::TY_Swift && !input.isPrimary()) {
input.getType() == file_types::TY_Swift) {
buffers = ModuleBuffers(llvm::MemoryBuffer::getMemBuffer(
"// missing file\n", input.getFileName()));
}