Frontend: fix after #27464

try to invoke a std::unique_ptr<>'s copy constructor, which is deleted.
Either move the unique_ptr or pass along a nullptr.  This should repair
the Windows build.
This commit is contained in:
Saleem Abdulrasool
2019-10-10 21:18:58 -07:00
parent 37afa7cf98
commit 684341ec49

View File

@@ -511,11 +511,11 @@ Optional<CompilerInstance::ModuleBuffers> CompilerInstance::getInputBuffersIfPre
if (!serialization::isSerializedAST((*inputFileOrErr)->getBuffer()))
return ModuleBuffers(std::move(*inputFileOrErr));
return ModuleBuffers(
std::move(*inputFileOrErr),
openModuleDoc(input).getValueOr(nullptr),
openModuleSourceInfo(input).getValueOr(nullptr)
);
auto swiftdoc = openModuleDoc(input);
auto sourceinfo = openModuleSourceInfo(input);
return ModuleBuffers(std::move(*inputFileOrErr),
swiftdoc.hasValue() ? std::move(swiftdoc.getValue()) : nullptr,
sourceinfo.hasValue() ? std::move(sourceinfo.getValue()) : nullptr);
}
Optional<std::unique_ptr<llvm::MemoryBuffer>>