@@ -128,19 +128,14 @@ SourceRange AbstractStmtScope::getSourceRangeOfThisASTNode(
128128
129129SourceRange DefaultArgumentInitializerScope::getSourceRangeOfThisASTNode (
130130 const bool omitAssertions) const {
131- if (auto *dv = decl->getStructuralDefaultExpr ())
132- return dv->getSourceRange ();
133- return SourceRange ();
131+ return decl->getStructuralDefaultExpr ()->getSourceRange ();
134132}
135133
136134SourceRange PatternEntryDeclScope::getSourceRangeOfThisASTNode (
137135 const bool omitAssertions) const {
138136 SourceRange range = getPatternEntry ().getSourceRange ();
139- if (endLoc.hasValue ()) {
140- ASTScopeAssert (endLoc->isValid (),
141- " BraceStmt ends before pattern binding entry?" );
137+ if (endLoc.hasValue ())
142138 range.End = *endLoc;
143- }
144139 return range;
145140}
146141
@@ -244,20 +239,7 @@ SourceRange AbstractFunctionDeclScope::getSourceRangeOfThisASTNode(
244239
245240SourceRange ParameterListScope::getSourceRangeOfThisASTNode (
246241 const bool omitAssertions) const {
247- auto rangeForGoodInput = params->getSourceRange ();
248- auto r = SourceRange (rangeForGoodInput.Start ,
249- fixupEndForBadInput (rangeForGoodInput));
250- ASTScopeAssert (getSourceManager ().rangeContains (
251- getParent ().get ()->getSourceRangeOfThisASTNode (true ), r),
252- " Parameters not within function?!" );
253- return r;
254- }
255-
256- SourceLoc ParameterListScope::fixupEndForBadInput (
257- const SourceRange rangeForGoodInput) const {
258- const auto s = rangeForGoodInput.Start ;
259- const auto e = rangeForGoodInput.End ;
260- return getSourceManager ().isBeforeInBuffer (s, e) ? e : s;
242+ return params->getSourceRange ();
261243}
262244
263245SourceRange ForEachPatternScope::getSourceRangeOfThisASTNode (
0 commit comments