Skip to content

Commit db902a1

Browse files
authored
Merge pull request #27618 from compnerd/27464
2 parents 09299de + 684341e commit db902a1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/Frontend/Frontend.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,11 @@ Optional<CompilerInstance::ModuleBuffers> CompilerInstance::getInputBuffersIfPre
511511
if (!serialization::isSerializedAST((*inputFileOrErr)->getBuffer()))
512512
return ModuleBuffers(std::move(*inputFileOrErr));
513513

514-
return ModuleBuffers(
515-
std::move(*inputFileOrErr),
516-
openModuleDoc(input).getValueOr(nullptr),
517-
openModuleSourceInfo(input).getValueOr(nullptr)
518-
);
514+
auto swiftdoc = openModuleDoc(input);
515+
auto sourceinfo = openModuleSourceInfo(input);
516+
return ModuleBuffers(std::move(*inputFileOrErr),
517+
swiftdoc.hasValue() ? std::move(swiftdoc.getValue()) : nullptr,
518+
sourceinfo.hasValue() ? std::move(sourceinfo.getValue()) : nullptr);
519519
}
520520

521521
Optional<std::unique_ptr<llvm::MemoryBuffer>>

0 commit comments

Comments
 (0)