SourceEntityWalker: Add a parameter to visitDeclReference() describing the kind of the reference under visit. NFC

This commit is contained in:
Xi Ge
2016-12-20 14:29:12 -08:00
parent dbefa60605
commit 14f968a5ed
10 changed files with 66 additions and 33 deletions

View File

@@ -771,7 +771,8 @@ public:
: SM(SM), BufferID(BufferID) {}
bool visitDeclReference(ValueDecl *D, CharSourceRange Range,
TypeDecl *CtorTyRef, Type T) override {
TypeDecl *CtorTyRef, Type T,
SemaReferenceKind Kind) override {
if (isa<VarDecl>(D) && D->hasName() && D->getName().str() == "self")
return true;
@@ -788,7 +789,8 @@ public:
bool visitSubscriptReference(ValueDecl *D, CharSourceRange Range,
bool IsOpenBracket) override {
// We should treat both open and close brackets equally
return visitDeclReference(D, Range, nullptr, Type());
return visitDeclReference(D, Range, nullptr, Type(),
SemaReferenceKind::SubscriptRef);
}
void annotate(const Decl *D, bool IsRef, CharSourceRange Range) {