[RangeInfo] When reporting referenced decls in a given range, exclude those references accessed as members.

This commit is contained in:
Xi Ge
2016-12-20 17:11:18 -08:00
parent 14f968a5ed
commit 2312ccecac
3 changed files with 64 additions and 7 deletions

View File

@@ -423,7 +423,12 @@ public:
return ResolvedRangeInfo();
}
void analyzeDeclRef(ValueDecl *VD, CharSourceRange Range, Type Ty) {
void analyzeDeclRef(ValueDecl *VD, CharSourceRange Range, Type Ty,
SemaReferenceKind Kind) {
// Only collect decl ref.
if (Kind != SemaReferenceKind::DeclRef)
return;
if (!isContainedInSelection(Range))
return;
@@ -509,7 +514,7 @@ bool RangeResolver::walkToDeclPost(Decl *D) {
bool RangeResolver::
visitDeclReference(ValueDecl *D, CharSourceRange Range, TypeDecl *CtorTyRef,
Type T, SemaReferenceKind Kind) {
Impl->analyzeDeclRef(D, Range, T);
Impl->analyzeDeclRef(D, Range, T, Kind);
return true;
}