This is an archive of the discontinued LLVM Phabricator instance.

[clangd][remote] Check an index file correctly
ClosedPublic

Authored by ArcsinX on Nov 8 2020, 11:59 PM.

Details

Summary

There is not reason to check std::make_unique<...>(..) return value,
but clangd::clang::loadIndex() returns nullptr if an index file could not be loaded (e.g. incorrect version).

Diff Detail

Event Timeline

ArcsinX created this revision.Nov 8 2020, 11:59 PM
ArcsinX requested review of this revision.Nov 8 2020, 11:59 PM
kadircet accepted this revision.Nov 9 2020, 12:18 AM
kadircet added inline comments.
clang-tools-extra/clangd/index/remote/server/Server.cpp
365

well actually we don't need to make unique at all. why not just create a SwapIndex Idx(std::move(SymIndex)) and pass it around ?

This revision is now accepted and ready to land.Nov 9 2020, 12:18 AM
ArcsinX updated this revision to Diff 303766.Nov 9 2020, 12:34 AM

Do not use unique pointer for Index

ArcsinX marked an inline comment as done.Nov 9 2020, 12:35 AM
This revision was landed with ongoing or failed builds.Nov 9 2020, 10:43 AM
This revision was automatically updated to reflect the committed changes.