From cfde3edeae4730aa44642c4835bcfa5a857ea8d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Duncan=20P=2E=20N=2E=20Exon=C2=A0Smith?= Date: Sat, 7 Nov 2020 20:44:09 -0500 Subject: [PATCH] Frontend: Remove unused parameter from ASTUnit::LoadFromCompilerInvocationAction, NFC Drop `IncludeBriefCommentsInCodeCompletion` since it is always `false`. Differential Revision: https://reviews.llvm.org/D91295 --- clang/include/clang/Frontend/ASTUnit.h | 1 - clang/lib/Frontend/ASTUnit.cpp | 6 ++---- clang/tools/libclang/Indexing.cpp | 4 +--- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/clang/include/clang/Frontend/ASTUnit.h b/clang/include/clang/Frontend/ASTUnit.h index 50ab86e..5595b8c 100644 --- a/clang/include/clang/Frontend/ASTUnit.h +++ b/clang/include/clang/Frontend/ASTUnit.h @@ -756,7 +756,6 @@ public: CaptureDiagsKind CaptureDiagnostics = CaptureDiagsKind::None, unsigned PrecompilePreambleAfterNParses = 0, bool CacheCodeCompletionResults = false, - bool IncludeBriefCommentsInCodeCompletion = false, bool UserFilesAreVolatile = false, std::unique_ptr *ErrAST = nullptr); diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index e1aa368..a112117 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -1520,8 +1520,7 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocationAction( ASTUnit *Unit, bool Persistent, StringRef ResourceFilesPath, bool OnlyLocalDecls, CaptureDiagsKind CaptureDiagnostics, unsigned PrecompilePreambleAfterNParses, bool CacheCodeCompletionResults, - bool IncludeBriefCommentsInCodeCompletion, bool UserFilesAreVolatile, - std::unique_ptr *ErrAST) { + bool UserFilesAreVolatile, std::unique_ptr *ErrAST) { assert(CI && "A CompilerInvocation is required"); std::unique_ptr OwnAST; @@ -1544,8 +1543,7 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocationAction( AST->PreambleRebuildCountdown = PrecompilePreambleAfterNParses; AST->TUKind = Action ? Action->getTranslationUnitKind() : TU_Complete; AST->ShouldCacheCodeCompletionResults = CacheCodeCompletionResults; - AST->IncludeBriefCommentsInCodeCompletion - = IncludeBriefCommentsInCodeCompletion; + AST->IncludeBriefCommentsInCodeCompletion = false; // Recover resources if we crash before exiting this method. llvm::CrashRecoveryContextCleanupRegistrar diff --git a/clang/tools/libclang/Indexing.cpp b/clang/tools/libclang/Indexing.cpp index f0303fd..0e83ec6 100644 --- a/clang/tools/libclang/Indexing.cpp +++ b/clang/tools/libclang/Indexing.cpp @@ -617,9 +617,7 @@ static CXErrorCode clang_indexSourceFile_Impl( std::move(CInvok), CXXIdx->getPCHContainerOperations(), Diags, IndexAction.get(), UPtr, Persistent, CXXIdx->getClangResourcesPath(), OnlyLocalDecls, CaptureDiagnostics, PrecompilePreambleAfterNParses, - CacheCodeCompletionResults, - /*IncludeBriefCommentsInCodeCompletion=*/false, - /*UserFilesAreVolatile=*/true); + CacheCodeCompletionResults, /*UserFilesAreVolatile=*/true); if (DiagTrap.hasErrorOccurred() && CXXIdx->getDisplayDiagnostics()) printDiagsToStderr(UPtr); -- 2.7.4