@@ -128,19 +128,14 @@ SourceRange AbstractStmtScope::getSourceRangeOfThisASTNode(
128
128
129
129
SourceRange DefaultArgumentInitializerScope::getSourceRangeOfThisASTNode (
130
130
const bool omitAssertions) const {
131
- if (auto *dv = decl->getStructuralDefaultExpr ())
132
- return dv->getSourceRange ();
133
- return SourceRange ();
131
+ return decl->getStructuralDefaultExpr ()->getSourceRange ();
134
132
}
135
133
136
134
SourceRange PatternEntryDeclScope::getSourceRangeOfThisASTNode (
137
135
const bool omitAssertions) const {
138
136
SourceRange range = getPatternEntry ().getSourceRange ();
139
- if (endLoc.hasValue ()) {
140
- ASTScopeAssert (endLoc->isValid (),
141
- " BraceStmt ends before pattern binding entry?" );
137
+ if (endLoc.hasValue ())
142
138
range.End = *endLoc;
143
- }
144
139
return range;
145
140
}
146
141
@@ -244,20 +239,7 @@ SourceRange AbstractFunctionDeclScope::getSourceRangeOfThisASTNode(
244
239
245
240
SourceRange ParameterListScope::getSourceRangeOfThisASTNode (
246
241
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 ();
261
243
}
262
244
263
245
SourceRange ForEachPatternScope::getSourceRangeOfThisASTNode (
0 commit comments