Skip to content

Commit a5768a9

Browse files
authored
Merge pull request #80407 from hamishknight/locced-out
[AST] Remove AccessorDecl handling from `getSourceRangeIncludingAttrs`
2 parents 3992fd9 + 995528e commit a5768a9

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

lib/AST/Decl.cpp

-20
Original file line numberDiff line numberDiff line change
@@ -966,26 +966,6 @@ case DeclKind::ID: return cast<ID##Decl>(this)->getSourceRange();
966966
SourceRange Decl::getSourceRangeIncludingAttrs() const {
967967
auto Range = getSourceRange();
968968

969-
// Attributes on AccessorDecl may syntactically belong to PatternBindingDecl.
970-
// e.g. 'override'.
971-
if (auto *AD = dyn_cast<AccessorDecl>(this)) {
972-
// If this is implicit getter, accessor range should not include attributes.
973-
if (AD->isImplicitGetter())
974-
return Range;
975-
976-
// Otherwise, include attributes directly attached to the accessor.
977-
SourceLoc VarLoc = AD->getStorage()->getStartLoc();
978-
for (auto *Attr : getParsedAttrs()) {
979-
if (!Attr->getRange().isValid())
980-
continue;
981-
982-
SourceLoc AttrStartLoc = Attr->getRangeWithAt().Start;
983-
if (getASTContext().SourceMgr.isBeforeInBuffer(VarLoc, AttrStartLoc))
984-
Range.widen(AttrStartLoc);
985-
}
986-
return Range;
987-
}
988-
989969
// Attributes on VarDecl syntactically belong to PatternBindingDecl.
990970
if (isa<VarDecl>(this) && !isa<ParamDecl>(this))
991971
return Range;

0 commit comments

Comments
 (0)