diff options
author | Jan Korous <jkorous@apple.com> | 2019-08-27 21:49:39 +0000 |
---|---|---|
committer | Jan Korous <jkorous@apple.com> | 2019-08-27 21:49:39 +0000 |
commit | cfd641d84a5ecda9fc466a8568b557eef4fd4d24 (patch) | |
tree | d9350b1ec2fb9683ecbcae78bffa28b95947fed8 | |
parent | 4368971b05cc81d35c18086cef2165a974ceb631 (diff) | |
download | bcm5719-llvm-cfd641d84a5ecda9fc466a8568b557eef4fd4d24.tar.gz bcm5719-llvm-cfd641d84a5ecda9fc466a8568b557eef4fd4d24.zip |
[clang][Index][NFC] Move IndexDataConsumer default implementation
llvm-svn: 370116
-rw-r--r-- | clang/include/clang/Index/IndexDataConsumer.h | 16 | ||||
-rw-r--r-- | clang/lib/Index/IndexingAction.cpp | 21 |
2 files changed, 11 insertions, 26 deletions
diff --git a/clang/include/clang/Index/IndexDataConsumer.h b/clang/include/clang/Index/IndexDataConsumer.h index bc1d86696df..72747821bf5 100644 --- a/clang/include/clang/Index/IndexDataConsumer.h +++ b/clang/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<SymbolRelation> 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/clang/lib/Index/IndexingAction.cpp b/clang/lib/Index/IndexingAction.cpp index 710be3f7120..41f1008a475 100644 --- a/clang/lib/Index/IndexingAction.cpp +++ b/clang/lib/Index/IndexingAction.cpp @@ -21,27 +21,6 @@ using namespace clang; using namespace clang::index; -bool IndexDataConsumer::handleDeclOccurence(const Decl *D, SymbolRoleSet Roles, - ArrayRef<SymbolRelation> 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 { |