From 9e9f8b7c6fc1e2f729253ec29946196fb2f4c2f6 Mon Sep 17 00:00:00 2001 From: Jan Korous Date: Tue, 27 Aug 2019 21:49:39 +0000 Subject: [PATCH] [clang][Index][NFC] Move IndexDataConsumer default implementation git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370116 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Index/IndexDataConsumer.h | 16 +++++++++++----- lib/Index/IndexingAction.cpp | 21 --------------------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/include/clang/Index/IndexDataConsumer.h b/include/clang/Index/IndexDataConsumer.h index bc1d86696d..72747821bf 100644 --- a/include/clang/Index/IndexDataConsumer.h +++ b/include/clang/Index/IndexDataConsumer.h @@ -32,7 +32,7 @@ public: const DeclContext *ContainerDC; }; - virtual ~IndexDataConsumer() {} + virtual ~IndexDataConsumer() = default; virtual void initialize(ASTContext &Ctx) {} @@ -41,12 +41,16 @@ public: /// \returns true to continue indexing, or false to abort. virtual bool handleDeclOccurence(const Decl *D, SymbolRoleSet Roles, ArrayRef Relations, - SourceLocation Loc, ASTNodeInfo ASTNode); + SourceLocation Loc, ASTNodeInfo ASTNode) { + return true; + } /// \returns true to continue indexing, or false to abort. virtual bool handleMacroOccurence(const IdentifierInfo *Name, const MacroInfo *MI, SymbolRoleSet Roles, - SourceLocation Loc); + SourceLocation Loc) { + return true; + } /// \returns true to continue indexing, or false to abort. /// @@ -54,8 +58,10 @@ public: /// For "@import MyMod.SubMod", there will be a call for 'MyMod' with the /// 'reference' role, and a call for 'SubMod' with the 'declaration' role. virtual bool handleModuleOccurence(const ImportDecl *ImportD, - const Module *Mod, - SymbolRoleSet Roles, SourceLocation Loc); + const Module *Mod, SymbolRoleSet Roles, + SourceLocation Loc) { + return true; + } virtual void finish() {} }; diff --git a/lib/Index/IndexingAction.cpp b/lib/Index/IndexingAction.cpp index 710be3f712..41f1008a47 100644 --- a/lib/Index/IndexingAction.cpp +++ b/lib/Index/IndexingAction.cpp @@ -21,27 +21,6 @@ using namespace clang; using namespace clang::index; -bool IndexDataConsumer::handleDeclOccurence(const Decl *D, SymbolRoleSet Roles, - ArrayRef Relations, - SourceLocation Loc, - ASTNodeInfo ASTNode) { - return true; -} - -bool IndexDataConsumer::handleMacroOccurence(const IdentifierInfo *Name, - const MacroInfo *MI, - SymbolRoleSet Roles, - SourceLocation Loc) { - return true; -} - -bool IndexDataConsumer::handleModuleOccurence(const ImportDecl *ImportD, - const Module *Mod, - SymbolRoleSet Roles, - SourceLocation Loc) { - return true; -} - namespace { class IndexASTConsumer : public ASTConsumer { -- 2.40.0