File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,14 @@ class DeclNameLoc {
105
105
return getSourceLocs ()[FirstArgumentLabelIndex + index];
106
106
}
107
107
108
+ SourceLoc getStartLoc () const {
109
+ return getBaseNameLoc ();
110
+ }
111
+
112
+ SourceLoc getEndLoc () const {
113
+ return NumArgumentLabels == 0 ? getBaseNameLoc () : getRParenLoc ();
114
+ }
115
+
108
116
// / Retrieve the complete source range for this declaration name.
109
117
SourceRange getSourceRange () const {
110
118
if (NumArgumentLabels == 0 ) return getBaseNameLoc ();
Original file line number Diff line number Diff line change @@ -2339,7 +2339,10 @@ class SubscriptExpr final : public Expr,
2339
2339
2340
2340
SourceLoc getLoc () const { return Index->getStartLoc (); }
2341
2341
SourceLoc getStartLoc () const { return Base->getStartLoc (); }
2342
- SourceLoc getEndLoc () const { return Index->getEndLoc (); }
2342
+ SourceLoc getEndLoc () const {
2343
+ auto end = Index->getEndLoc ();
2344
+ return end.isValid () ? end : Base->getEndLoc ();
2345
+ }
2343
2346
2344
2347
static bool classof (const Expr *E) {
2345
2348
return E->getKind () == ExprKind::Subscript;
@@ -2396,7 +2399,7 @@ class UnresolvedDotExpr : public Expr {
2396
2399
: SubExpr->getStartLoc ());
2397
2400
}
2398
2401
SourceLoc getEndLoc () const {
2399
- return NameLoc.getSourceRange ().End ;
2402
+ return NameLoc.getSourceRange ().End ;
2400
2403
}
2401
2404
2402
2405
SourceLoc getDotLoc () const { return DotLoc; }
You can’t perform that action at this time.
0 commit comments