@@ -89,8 +89,8 @@ class CursorInfoResolver : public SourceEntityWalker {
8989 bool walkToDeclPost (Decl *D) override ;
9090 bool walkToStmtPre (Stmt *S) override ;
9191 bool walkToStmtPost (Stmt *S) override ;
92- bool visitDeclReference (ValueDecl *D, CharSourceRange Range,
93- TypeDecl *CtorTyRef, ExtensionDecl *ExtTyRef, Type T,
92+ bool visitDeclReference (ValueDecl *D, SourceRange Range, TypeDecl *CtorTyRef ,
93+ ExtensionDecl *ExtTyRef, Type T,
9494 ReferenceMetaData Data) override ;
9595 bool visitCallArgName (Identifier Name, CharSourceRange Range,
9696 ValueDecl *D) override ;
@@ -105,7 +105,7 @@ class CursorInfoResolver : public SourceEntityWalker {
105105 std::optional<ReferenceMetaData> Data = std::nullopt);
106106 bool tryResolve (ModuleEntity Mod, SourceLoc Loc);
107107 bool tryResolve (Stmt *St);
108- bool visitSubscriptReference (ValueDecl *D, CharSourceRange Range,
108+ bool visitSubscriptReference (ValueDecl *D, SourceRange Range,
109109 ReferenceMetaData Data,
110110 bool IsOpenBracket) override ;
111111};
@@ -210,7 +210,7 @@ bool CursorInfoResolver::tryResolve(Stmt *St) {
210210}
211211
212212bool CursorInfoResolver::visitSubscriptReference (ValueDecl *D,
213- CharSourceRange Range,
213+ SourceRange Range,
214214 ReferenceMetaData Data,
215215 bool IsOpenBracket) {
216216 // We should treat both open and close brackets equally
@@ -301,16 +301,16 @@ bool CursorInfoResolver::walkToStmtPost(Stmt *S) {
301301 return true ;
302302}
303303
304- bool CursorInfoResolver::visitDeclReference (ValueDecl *D,
305- CharSourceRange Range,
304+ bool CursorInfoResolver::visitDeclReference (ValueDecl *D, SourceRange Range,
306305 TypeDecl *CtorTyRef,
307306 ExtensionDecl *ExtTyRef, Type T,
308307 ReferenceMetaData Data) {
309308 if (isDone ())
310309 return false ;
311310 if (Data.isImplicit || !Range.isValid ())
312311 return true ;
313- return !tryResolve (D, CtorTyRef, ExtTyRef, Range.getStart (), /* IsRef=*/ true , T, Data);
312+ return !tryResolve (D, CtorTyRef, ExtTyRef, Range.Start , /* IsRef=*/ true , T,
313+ Data);
314314}
315315
316316static bool isCursorOn (Expr *E, SourceLoc Loc) {
@@ -461,8 +461,8 @@ class RangeResolver : public SourceEntityWalker {
461461 bool walkToStmtPost (Stmt *S) override ;
462462 bool walkToDeclPre (Decl *D, CharSourceRange Range) override ;
463463 bool walkToDeclPost (Decl *D) override ;
464- bool visitDeclReference (ValueDecl *D, CharSourceRange Range,
465- TypeDecl *CtorTyRef, ExtensionDecl *ExtTyRef, Type T,
464+ bool visitDeclReference (ValueDecl *D, SourceRange Range, TypeDecl *CtorTyRef ,
465+ ExtensionDecl *ExtTyRef, Type T,
466466 ReferenceMetaData Data) override ;
467467 ResolvedRangeInfo moveArrayToASTContext (ResolvedRangeInfo Info);
468468public:
@@ -799,12 +799,13 @@ struct RangeResolver::Implementation {
799799 Impl->analyzeDecl (D);
800800 return true ;
801801 }
802- bool visitDeclReference (ValueDecl *D, CharSourceRange Range,
803- TypeDecl *CtorTyRef, ExtensionDecl *ExtTyRef, Type T,
804- ReferenceMetaData Data) override {
805- Impl->analyzeDeclRef (D, Range.getStart () , T, Data);
802+ bool visitDeclReference (ValueDecl *D, SourceRange Range,
803+ TypeDecl *CtorTyRef, ExtensionDecl *ExtTyRef,
804+ Type T, ReferenceMetaData Data) override {
805+ Impl->analyzeDeclRef (D, Range.Start , T, Data);
806806 return true ;
807807 }
808+
808809 public:
809810 CompleteWalker (Implementation *Impl) : Impl(Impl) {}
810811 };
@@ -813,11 +814,11 @@ struct RangeResolver::Implementation {
813814 // / decls in the range is referenced after it.
814815 class FurtherReferenceWalker : public SourceEntityWalker {
815816 Implementation *Impl;
816- bool visitDeclReference (ValueDecl *D, CharSourceRange Range,
817- TypeDecl *CtorTyRef, ExtensionDecl *ExtTyRef, Type T,
818- ReferenceMetaData Data) override {
817+ bool visitDeclReference (ValueDecl *D, SourceRange Range,
818+ TypeDecl *CtorTyRef, ExtensionDecl *ExtTyRef,
819+ Type T, ReferenceMetaData Data) override {
819820 // If the reference is after the given range, continue logic.
820- if (!Impl->SM .isBeforeInBuffer (Impl->End , Range.getStart () ))
821+ if (!Impl->SM .isBeforeInBuffer (Impl->End , Range.Start ))
821822 return true ;
822823
823824 // If the referenced decl is declared in the range, than the declared decl
@@ -829,6 +830,7 @@ struct RangeResolver::Implementation {
829830 }
830831 return true ;
831832 }
833+
832834 public:
833835 FurtherReferenceWalker (Implementation *Impl) : Impl(Impl) {}
834836 };
@@ -1140,11 +1142,11 @@ bool RangeResolver::walkToDeclPost(Decl *D) {
11401142 return !Impl->hasResult ();
11411143}
11421144
1143-
1144- bool RangeResolver::
1145- visitDeclReference (ValueDecl *D, CharSourceRange Range, TypeDecl *CtorTyRef ,
1146- ExtensionDecl *ExtTyRef, Type T, ReferenceMetaData Data) {
1147- Impl->analyzeDeclRef (D, Range.getStart () , T, Data);
1145+ bool RangeResolver::visitDeclReference (ValueDecl *D, SourceRange Range,
1146+ TypeDecl *CtorTyRef,
1147+ ExtensionDecl *ExtTyRef, Type T ,
1148+ ReferenceMetaData Data) {
1149+ Impl->analyzeDeclRef (D, Range.Start , T, Data);
11481150 return true ;
11491151}
11501152
0 commit comments