Skip to content

Frontend: fix after #27464 #27618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/Frontend/Frontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boo, this shouldn't formally do a copy. :-( Can we update LLVM_HAS_RVALUE_REFERENCE_THIS in Compiler.h instead? Or does MSVC still not have it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that MSVC does support rvalue reference this (VS2019 probably does, VS2017 is what Im worried about). LLVM_HAS_RVALUE_REFERENCE_THIS was removed (by JF) recently actually IIRC.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like they got re-added. Oh well.

apple/swift-llvm@4ed5b9a

);
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>>
Expand Down