[SourceKit] In interface-gen request, allow clients to send SourceKit an interested USR from which we can infer the group name.

This commit is contained in:
Xi Ge
2016-03-23 17:25:53 -07:00
parent 41efb3d4d3
commit fda0751cae
20 changed files with 110 additions and 13 deletions

View File

@@ -1646,6 +1646,14 @@ ModuleFile::getCommentForDeclByUSR(StringRef USR) const {
return *I;
}
Optional<StringRef>
ModuleFile::getGroupNameByUSR(StringRef USR) const {
if (auto Comment = getCommentForDeclByUSR(USR)) {
return getGroupNameById(Comment.getValue().Group);
}
return None;
}
Identifier ModuleFile::getDiscriminatorForPrivateValue(const ValueDecl *D) {
Identifier discriminator = PrivateDiscriminatorsByValue.lookup(D);
assert(!discriminator.empty() && "no discriminator found for decl");