This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Make dexp command line options sticky
ClosedPublic

Authored by yrouban on Mar 1 2022, 4:00 AM.

Details

Summary

Preparing for the cl::opt reset fix proposed on D115433 this patch fixes the dexp tool to preserve its three command line options (IndexLocation, ExecCommand, ProjectRoot) from reset that is done before parsing query options.

Diff Detail

Event Timeline

yrouban created this revision.Mar 1 2022, 4:00 AM
yrouban requested review of this revision.Mar 1 2022, 4:00 AM
lattner resigned from this revision.Mar 1 2022, 9:57 PM

I'm not a competent reviewer for clangd

Herald added a project: Restricted Project. · View Herald TranscriptMar 1 2022, 9:57 PM
jhenderson resigned from this revision.Mar 1 2022, 10:32 PM

I don't know anything about clangd either. Not sure why I was added as a reviewer :)

I'm not a competent reviewer for clangd

! In D120713#3353532, @jhenderson wrote:

I don't know anything about clangd either. Not sure why I was added as a reviewer :)

I took your names from https://reviews.llvm.org/D105959 which affected Dexp.cpp and was related to cl::opt.
Ok, I will shoot in the dark once more :)

sammccall accepted this revision.Mar 8 2022, 1:15 AM

Thank you!

clang-tools-extra/clangd/index/dex/dexp/Dexp.cpp
417

nit: comment echoes the code, say why instead?

Preserve global options when flag parser is reset, so commands can use them.

This revision is now accepted and ready to land.Mar 8 2022, 1:15 AM
kadircet added inline comments.Mar 8 2022, 3:24 AM
clang-tools-extra/clangd/index/dex/dexp/Dexp.cpp
418

also nit: /*initial=*/ true. same below

yrouban marked 2 inline comments as done.Mar 8 2022, 8:46 PM