Skip to content

[index] Add finish() hook to the index consumer API #2972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/swift/Index/IndexDataConsumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class IndexDataConsumer {
virtual bool recordRelatedEntity(const IndexSymbol &symbol) = 0;
virtual bool finishSourceEntity(SymbolKind kind, SymbolSubKindSet subKinds,
SymbolRoleSet roles) = 0;

virtual void finish() {}
};

} // end namespace index
Expand Down
2 changes: 2 additions & 0 deletions lib/Index/Index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,7 @@ void index::indexSourceFile(SourceFile *SF, StringRef hash,
unsigned bufferID = SF->getBufferID().getValue();
IndexSwiftASTWalker walker(consumer, SF->getASTContext(), bufferID);
walker.visitModule(*SF->getParentModule(), hash);
consumer.finish();
}

void index::indexModule(ModuleDecl *module, StringRef hash,
Expand All @@ -1077,4 +1078,5 @@ void index::indexModule(ModuleDecl *module, StringRef hash,
IndexSwiftASTWalker walker(consumer, module->getASTContext(),
/*bufferID*/ -1);
walker.visitModule(*module, hash);
consumer.finish();
}