mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-16 22:06:04 +00:00
[clang][Index][NFC] Move IndexDataConsumer default implementation
llvm-svn: 370116
This commit is contained in:
parent
4368971b05
commit
cfd641d84a
@ -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() {}
|
||||
};
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user