r370116 - [clang][Index][NFC] Move IndexDataConsumer default implementation
Jan Korous via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 27 14:49:42 PDT 2019
Author: jkorous
Date: Tue Aug 27 14:49:39 2019
New Revision: 370116
URL: http://llvm.org/viewvc/llvm-project?rev=370116&view=rev
Log:
[clang][Index][NFC] Move IndexDataConsumer default implementation
Modified:
cfe/trunk/include/clang/Index/IndexDataConsumer.h
cfe/trunk/lib/Index/IndexingAction.cpp
Modified: cfe/trunk/include/clang/Index/IndexDataConsumer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Index/IndexDataConsumer.h?rev=370116&r1=370115&r2=370116&view=diff
==============================================================================
--- cfe/trunk/include/clang/Index/IndexDataConsumer.h (original)
+++ cfe/trunk/include/clang/Index/IndexDataConsumer.h Tue Aug 27 14:49:39 2019
@@ -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() {}
};
Modified: cfe/trunk/lib/Index/IndexingAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/IndexingAction.cpp?rev=370116&r1=370115&r2=370116&view=diff
==============================================================================
--- cfe/trunk/lib/Index/IndexingAction.cpp (original)
+++ cfe/trunk/lib/Index/IndexingAction.cpp Tue Aug 27 14:49:39 2019
@@ -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 {
More information about the cfe-commits
mailing list