Skip to content

Commit 84febf6

Browse files
committed
[AST] Remove a couple of checks from FuncDecl::getSourceRange
These don't appear to be necessary, let's mirror the logic in `getStartLoc` and remove them.
1 parent e0ceb85 commit 84febf6

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lib/AST/Decl.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11482,15 +11482,8 @@ SourceRange FuncDecl::getSourceRange() const {
1148211482
return SourceRange();
1148311483

1148411484
SourceLoc endLoc = getOriginalBodySourceRange().End;
11485-
if (endLoc.isInvalid()) {
11486-
if (isa<AccessorDecl>(this))
11487-
return startLoc;
11488-
11489-
if (getBodyKind() == BodyKind::Synthesize)
11490-
return SourceRange();
11491-
11485+
if (endLoc.isInvalid())
1149211486
endLoc = getGenericTrailingWhereClauseSourceRange().End;
11493-
}
1149411487
if (endLoc.isInvalid())
1149511488
endLoc = getResultTypeSourceRange().End;
1149611489
if (endLoc.isInvalid())

0 commit comments

Comments
 (0)