Skip to content

Commit cfd641d

Browse files
committed
[clang][Index][NFC] Move IndexDataConsumer default implementation
llvm-svn: 370116
1 parent 4368971 commit cfd641d

File tree

2 files changed

+11
-26
lines changed

2 files changed

+11
-26
lines changed

clang/include/clang/Index/IndexDataConsumer.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class IndexDataConsumer {
3232
const DeclContext *ContainerDC;
3333
};
3434

35-
virtual ~IndexDataConsumer() {}
35+
virtual ~IndexDataConsumer() = default;
3636

3737
virtual void initialize(ASTContext &Ctx) {}
3838

@@ -41,21 +41,27 @@ class IndexDataConsumer {
4141
/// \returns true to continue indexing, or false to abort.
4242
virtual bool handleDeclOccurence(const Decl *D, SymbolRoleSet Roles,
4343
ArrayRef<SymbolRelation> Relations,
44-
SourceLocation Loc, ASTNodeInfo ASTNode);
44+
SourceLocation Loc, ASTNodeInfo ASTNode) {
45+
return true;
46+
}
4547

4648
/// \returns true to continue indexing, or false to abort.
4749
virtual bool handleMacroOccurence(const IdentifierInfo *Name,
4850
const MacroInfo *MI, SymbolRoleSet Roles,
49-
SourceLocation Loc);
51+
SourceLocation Loc) {
52+
return true;
53+
}
5054

5155
/// \returns true to continue indexing, or false to abort.
5256
///
5357
/// This will be called for each module reference in an import decl.
5458
/// For "@import MyMod.SubMod", there will be a call for 'MyMod' with the
5559
/// 'reference' role, and a call for 'SubMod' with the 'declaration' role.
5660
virtual bool handleModuleOccurence(const ImportDecl *ImportD,
57-
const Module *Mod,
58-
SymbolRoleSet Roles, SourceLocation Loc);
61+
const Module *Mod, SymbolRoleSet Roles,
62+
SourceLocation Loc) {
63+
return true;
64+
}
5965

6066
virtual void finish() {}
6167
};

clang/lib/Index/IndexingAction.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,6 @@
2121
using namespace clang;
2222
using namespace clang::index;
2323

24-
bool IndexDataConsumer::handleDeclOccurence(const Decl *D, SymbolRoleSet Roles,
25-
ArrayRef<SymbolRelation> Relations,
26-
SourceLocation Loc,
27-
ASTNodeInfo ASTNode) {
28-
return true;
29-
}
30-
31-
bool IndexDataConsumer::handleMacroOccurence(const IdentifierInfo *Name,
32-
const MacroInfo *MI,
33-
SymbolRoleSet Roles,
34-
SourceLocation Loc) {
35-
return true;
36-
}
37-
38-
bool IndexDataConsumer::handleModuleOccurence(const ImportDecl *ImportD,
39-
const Module *Mod,
40-
SymbolRoleSet Roles,
41-
SourceLocation Loc) {
42-
return true;
43-
}
44-
4524
namespace {
4625

4726
class IndexASTConsumer : public ASTConsumer {

0 commit comments

Comments
 (0)