[SourceKit] Add a new query to collect all group names from a module.

Input:
  Request Id: 'source.request.module.groups'
  Required field: 'key.modulename'

Output:
  Array of group names in that module, if any.
This commit is contained in:
Xi Ge
2016-02-08 17:02:36 -08:00
parent b0f94ed4b7
commit 329345077b
16 changed files with 163 additions and 1 deletions

View File

@@ -1556,6 +1556,14 @@ Optional<StringRef> ModuleFile::getGroupNameForDecl(const Decl *D) {
return getGroupNameById(Triple.getValue().Group);
}
void ModuleFile::collectAllGroups(std::vector<StringRef> &Names) {
if (!GroupNamesMap)
return;
for (auto It = GroupNamesMap->begin(); It != GroupNamesMap->end(); ++ It) {
Names.push_back(It->getSecond());
}
}
Optional<BriefAndRawComment> ModuleFile::getCommentForDeclByUSR(StringRef USR) {
if (!DeclCommentTable)
return None;