diff --git a/clang-tools-extra/clangd/ClangdServer.h b/clang-tools-extra/clangd/ClangdServer.h --- a/clang-tools-extra/clangd/ClangdServer.h +++ b/clang-tools-extra/clangd/ClangdServer.h @@ -118,14 +118,6 @@ /// checks will be disabled. TidyProviderRef ClangTidyProvider; - /// If true, force -frecovery-ast flag. - /// If false, respect the value in clang. - bool BuildRecoveryAST = false; - - /// If true, force -frecovery-ast-type flag. - /// If false, respect the value in clang. - bool PreserveRecoveryASTType = false; - /// Clangd's workspace root. Relevant for "workspace" operations not bound /// to a particular file. /// FIXME: If not set, should use the current working directory. @@ -388,11 +380,6 @@ // can be caused by missing includes (e.g. member access in incomplete type). bool SuggestMissingIncludes = false; - // If true, preserve expressions in AST for broken code. - bool BuildRecoveryAST = true; - // If true, preserve the type for recovery AST. - bool PreserveRecoveryASTType = false; - // GUARDED_BY(CachedCompletionFuzzyFindRequestMutex) llvm::StringMap> CachedCompletionFuzzyFindRequestByFile; diff --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp --- a/clang-tools-extra/clangd/ClangdServer.cpp +++ b/clang-tools-extra/clangd/ClangdServer.cpp @@ -147,8 +147,6 @@ : nullptr), ClangTidyProvider(Opts.ClangTidyProvider), SuggestMissingIncludes(Opts.SuggestMissingIncludes), - BuildRecoveryAST(Opts.BuildRecoveryAST), - PreserveRecoveryASTType(Opts.PreserveRecoveryASTType), WorkspaceRoot(Opts.WorkspaceRoot), // Pass a callback into `WorkScheduler` to extract symbols from a newly // parsed file and rebuild the file index synchronously each time an AST @@ -214,8 +212,6 @@ Inputs.Opts = std::move(Opts); Inputs.Index = Index; Inputs.ClangTidyProvider = ClangTidyProvider; - Inputs.Opts.BuildRecoveryAST = BuildRecoveryAST; - Inputs.Opts.PreserveRecoveryASTType = PreserveRecoveryASTType; bool NewFile = WorkScheduler.update(File, Inputs, WantDiags); // If we loaded Foo.h, we want to make sure Foo.cpp is indexed. if (NewFile && BackgroundIdx) @@ -253,8 +249,6 @@ } ParseInputs ParseInput{IP->Command, &TFS, IP->Contents.str()}; ParseInput.Index = Index; - ParseInput.Opts.BuildRecoveryAST = BuildRecoveryAST; - ParseInput.Opts.PreserveRecoveryASTType = PreserveRecoveryASTType; CodeCompleteOpts.MainFileSignals = IP->Signals; // FIXME(ibiryukov): even if Preamble is non-null, we may want to check @@ -300,8 +294,6 @@ ParseInputs ParseInput{IP->Command, &TFS, IP->Contents.str()}; ParseInput.Index = Index; - ParseInput.Opts.BuildRecoveryAST = BuildRecoveryAST; - ParseInput.Opts.PreserveRecoveryASTType = PreserveRecoveryASTType; CB(clangd::signatureHelp(File, Pos, *PreambleData, ParseInput)); }; diff --git a/clang-tools-extra/clangd/Compiler.h b/clang-tools-extra/clangd/Compiler.h --- a/clang-tools-extra/clangd/Compiler.h +++ b/clang-tools-extra/clangd/Compiler.h @@ -38,8 +38,6 @@ // Options to run clang e.g. when parsing AST. struct ParseOptions { bool SuggestMissingIncludes = false; - bool BuildRecoveryAST = false; - bool PreserveRecoveryASTType = false; }; /// Information required to run clang, e.g. to parse AST or do code completion. diff --git a/clang-tools-extra/clangd/Compiler.cpp b/clang-tools-extra/clangd/Compiler.cpp --- a/clang-tools-extra/clangd/Compiler.cpp +++ b/clang-tools-extra/clangd/Compiler.cpp @@ -85,11 +85,6 @@ // Don't crash on `#pragma clang __debug parser_crash` CI->getPreprocessorOpts().DisablePragmaDebugCrash = true; - if (Inputs.Opts.BuildRecoveryAST) - CI->getLangOpts()->RecoveryAST = true; - if (Inputs.Opts.PreserveRecoveryASTType) - CI->getLangOpts()->RecoveryASTType = true; - return CI; } diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp b/clang-tools-extra/clangd/tool/ClangdMain.cpp --- a/clang-tools-extra/clangd/tool/ClangdMain.cpp +++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp @@ -312,14 +312,15 @@ "recovery-ast", cat(Features), desc("Preserve expressions in AST for broken code."), - init(ClangdServer::Options().BuildRecoveryAST), + init(false), + Hidden, }; opt RecoveryASTType{ "recovery-ast-type", cat(Features), desc("Preserve the type for recovery AST."), - init(ClangdServer::Options().PreserveRecoveryASTType), + init(false), Hidden, }; @@ -813,8 +814,6 @@ Opts.StaticIndex = PAI.get(); } Opts.AsyncThreadsCount = WorkerThreadsCount; - Opts.BuildRecoveryAST = RecoveryAST; - Opts.PreserveRecoveryASTType = RecoveryASTType; Opts.FoldingRanges = FoldingRanges; Opts.MemoryCleanup = getMemoryCleanupFunction();