[clangd] Make dexp command line options sticky

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.

Tags: #clang
This commit is contained in:
Yevgeny Rouban 2022-03-09 12:59:49 +07:00
parent 81f8df0c83
commit c8a35727fe
1 changed files with 3 additions and 3 deletions

View File

@ -416,9 +416,9 @@ int main(int argc, const char *argv[]) {
// Preserve global options when flag parser is reset, so commands can use
// them.
IndexLocation.setValue(IndexLocation, /*initial=*/ true);
ExecCommand.setValue(ExecCommand, /*initial=*/ true);
ProjectRoot.setValue(ProjectRoot, /*initial=*/ true);
IndexLocation.setValue(IndexLocation, /*initial=*/true);
ExecCommand.setValue(ExecCommand, /*initial=*/true);
ProjectRoot.setValue(ProjectRoot, /*initial=*/true);
llvm::cl::ResetCommandLineParser(); // We reuse it for REPL commands.
llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);