Skip to content

Commit 571d815

Browse files
author
David Ungar
committed
Remove radar numbers.
1 parent a9ab4aa commit 571d815

File tree

3 files changed

+21
-27
lines changed

3 files changed

+21
-27
lines changed

include/swift/AST/ASTScope.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,7 @@ class ASTScopeImpl {
346346

347347
/// Expand or reexpand the scope if unexpanded or if not current.
348348
/// There are several places in the compiler that mutate the AST after the
349-
/// fact, above and beyond adding Decls to the SourceFile. These are
350-
/// documented in: rdar://53018839, rdar://53027266, rdar://53027733,
351-
/// rdar://53028050
349+
/// fact, above and beyond adding Decls to the SourceFile.
352350
ASTScopeImpl *expandAndBeCurrent(ScopeCreator &);
353351

354352
unsigned getASTAncestorScopeCount() const { return astAncestorScopeCount; }
@@ -546,7 +544,7 @@ class ASTSourceFileScope final : public ASTScopeImpl {
546544
/// The number of \c Decls in the \c SourceFile that were already seen.
547545
/// Since parsing can be interleaved with type-checking, on every
548546
/// lookup, look at creating scopes for any \c Decls beyond this number.
549-
/// rdar://55562483 Unify with numberOfChildrenWhenLastExpanded
547+
/// TODO: Unify with numberOfChildrenWhenLastExpanded
550548
size_t numberOfDeclsAlreadySeen = 0;
551549

552550
ASTSourceFileScope(SourceFile *SF, ScopeCreator *scopeCreator);
@@ -1164,7 +1162,6 @@ class AttachedPropertyWrapperScope final : public ASTScopeImpl {
11641162
/// false positives, that that doesn't hurt anything. However, the result of
11651163
/// the conservative source range computation doesn't seem to be stable. So
11661164
/// keep the original here, and use it for source range queries.
1167-
/// rdar://55263708
11681165

11691166
const SourceRange sourceRangeWhenCreated;
11701167

@@ -1267,7 +1264,6 @@ class PatternEntryDeclScope final : public AbstractPatternEntryScope {
12671264
};
12681265

12691266
class PatternEntryInitializerScope final : public AbstractPatternEntryScope {
1270-
// Should be able to remove this when rdar://53921703 is accomplished.
12711267
Expr *initAsWrittenWhenCreated;
12721268

12731269
public:

lib/AST/ASTScopeCreation.cpp

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ class ScopeCreator final {
383383

384384
// A safe way to discover this, without creating a circular request.
385385
// Cannot call getAttachedPropertyWrappers.
386-
// rdar://55263708
387386
static bool hasAttachedPropertyWrapper(VarDecl *vd) {
388387
return AttachedPropertyWrapperScope::getSourceRangeOfVarDecl(vd).isValid();
389388
}
@@ -432,21 +431,22 @@ class ScopeCreator final {
432431
if (auto *specializeAttr = dyn_cast<SpecializeAttr>(attr))
433432
sortedSpecializeAttrs.push_back(specializeAttr);
434433
}
435-
// Part of rdar://53921774 rm extra copy
434+
// TODO: rm extra copy
436435
for (auto *specializeAttr : sortBySourceRange(sortedSpecializeAttrs))
437436
fn(specializeAttr);
438437
}
439438

440439
std::vector<ASTNode> expandIfConfigClausesThenCullAndSortElementsOrMembers(
441440
ArrayRef<ASTNode> input) const {
442441
auto cleanedupNodes = sortBySourceRange(cull(expandIfConfigClauses(input)));
443-
// TODO: uncomment when working on rdar://53627317
442+
// TODO: uncomment when working on not creating two pattern binding decls at
443+
// same location.
444444
// findCollidingPatterns(cleanedupNodes);
445445
return cleanedupNodes;
446446
}
447447

448448
public:
449-
/// When ASTScopes are enabled for code completion, rdar://53321156
449+
/// When ASTScopes are enabled for code completion,
450450
/// IfConfigs will pose a challenge because we may need to field lookups into
451451
/// the inactive clauses, but the AST contains redundancy: the active clause's
452452
/// elements are present in the members or elements of an IterableTypeDecl or
@@ -484,7 +484,7 @@ class ScopeCreator final {
484484
if (auto *const cond = clause.Cond)
485485
expansion.push_back(cond);
486486
if (clause.isActive) {
487-
// rdar://53922172
487+
// TODO: Move this check into ASTVerifier
488488
ASTScopeAssert(isInAnActiveNode, "Clause should not be marked active "
489489
"unless it's context is active");
490490
// get inactive nodes that nest in active clauses
@@ -506,7 +506,8 @@ class ScopeCreator final {
506506
/// because they overlap EnumElements and AST includes the elements in the
507507
/// members.
508508
std::vector<ASTNode> cull(ArrayRef<ASTNode> input) const {
509-
// When working on rdar://53971116 may have to cull more.
509+
// TODO: Investigate whether to move the real EndLoc tracking of
510+
// SubscriptDecl up into AbstractStorageDecl. May have to cull more.
510511
std::vector<ASTNode> culled;
511512
llvm::copy_if(input, std::back_inserter(culled), [&](ASTNode n) {
512513
ASTScopeAssert(
@@ -519,7 +520,8 @@ class ScopeCreator final {
519520
}
520521

521522
/// TODO: The parser yields two decls at the same source loc with the same
522-
/// kind. Call me when tackling rdar://53627317, then move this to
523+
/// kind. TODO: me when fixing parser's proclivity to create two
524+
/// PatternBindingDecls at the same source location, then move this to
523525
/// ASTVerifier.
524526
///
525527
/// In all cases the first pattern seems to carry the initializer, and the
@@ -584,7 +586,6 @@ class ScopeCreator final {
584586
}
585587
}
586588

587-
/// See rdar://53921962
588589
/// Templated to work on either ASTNodes, Decl*'s, or whatnot.
589590
template <typename Rangeable>
590591
std::vector<Rangeable>
@@ -921,9 +922,10 @@ class NodeAdder
921922
auto *insertionPoint = parentScope;
922923
for (unsigned i = 0; i < patternBinding->getPatternList().size(); ++i) {
923924
// TODO: Won't need to do so much work to avoid creating one without
924-
// a SourceRange once rdar://53627317 is done and
925-
// getSourceRangeOfThisASTNode for PatternEntryDeclScope is simplified to
926-
// use the PatternEntry's source range.
925+
// a SourceRange once parser is fixed to not create two
926+
// PatternBindingDecls with same locaiton and getSourceRangeOfThisASTNode
927+
// for PatternEntryDeclScope is simplified to use the PatternEntry's
928+
// source range.
927929
auto &patternEntry = patternBinding->getPatternList()[i];
928930
if (!patternEntry.getOriginalInit()) {
929931
bool found = false;
@@ -1027,7 +1029,6 @@ void ScopeCreator::addChildrenForAllLocalizableAccessorsInSourceOrder(
10271029
});
10281030

10291031
// Sort in order to include synthesized ones, which are out of order.
1030-
// Part of rdar://53921774 rm extra copy
10311032
for (auto *accessor : sortBySourceRange(accessorsToScope))
10321033
addToScopeTree(accessor, parent);
10331034
}
@@ -1302,7 +1303,8 @@ GenericTypeOrExtensionScope::expandAScopeThatCreatesANewInsertionPoint(
13021303
AnnotatedInsertionPoint
13031304
BraceStmtScope::expandAScopeThatCreatesANewInsertionPoint(
13041305
ScopeCreator &scopeCreator) {
1305-
// TODO: remove the sort after performing rdar://53254395
1306+
// TODO: remove the sort after fixing parser to create brace statement
1307+
// elements in source order
13061308
auto *insertionPoint =
13071309
scopeCreator.addSiblingsToScopeTree(this, this, stmt->getElements());
13081310
if (auto *s = scopeCreator.getASTContext().Stats)
@@ -1346,7 +1348,6 @@ void AbstractFunctionDeclScope::expandAScopeThatDoesNotCreateANewInsertionPoint(
13461348
leaf = scopeCreator.addNestedGenericParamScopesToTree(
13471349
decl, decl->getGenericParams(), leaf);
13481350
if (isLocalizable(decl) && getParmsSourceLocOfAFD(decl).isValid()) {
1349-
// See rdar://54188611
13501351
// swift::createDesignatedInitOverride just clones the parameters, so they
13511352
// end up with a bogus SourceRange, maybe *before* the start of the
13521353
// function.
@@ -1441,8 +1442,6 @@ void ForEachStmtScope::expandAScopeThatDoesNotCreateANewInsertionPoint(
14411442
// let v: C { for b : Int -> S((array: P { }
14421443
// the body is implicit and it would overlap the source range of the expr
14431444
// above.
1444-
//
1445-
// TODO: refer to rdar://53921962
14461445
if (!stmt->getBody()->isImplicit()) {
14471446
if (isLocalizable(stmt->getBody()))
14481447
scopeCreator.constructExpandAndInsertUncheckable<ForEachPatternScope>(
@@ -1547,7 +1546,6 @@ ASTScopeImpl *GenericTypeOrExtensionWholePortion::expandScope(
15471546

15481547
// Prevent circular request bugs caused by illegal input and
15491548
// doing lookups that getExtendedNominal in the midst of getExtendedNominal.
1550-
// rdar://53972776
15511549
if (scope->shouldHaveABody() && !scope->doesDeclHaveABody())
15521550
return ip;
15531551

lib/AST/ASTScopeSourceRange.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ SourceRange DefaultArgumentInitializerScope::getSourceRangeOfThisASTNode(
232232

233233
SourceRange PatternEntryDeclScope::getSourceRangeOfThisASTNode(
234234
const bool omitAssertions) const {
235-
// TODO: Once rdar://53627317 is accomplished, the following may be able to be
236-
// simplified.
235+
// TODO: Once the creation of two PatternBindingDecls at same location is
236+
// eliminated, the following may be able to be simplified.
237237
if (!getChildren().empty()) { // why needed???
238238
bool hasOne = false;
239239
getPattern()->forEachVariable([&](VarDecl *) { hasOne = true; });
@@ -247,8 +247,8 @@ SourceRange PatternEntryDeclScope::getSourceRangeOfThisASTNode(
247247

248248
SourceRange PatternEntryInitializerScope::getSourceRangeOfThisASTNode(
249249
const bool omitAssertions) const {
250-
// See rdar://53921703
251-
// Note: grep for "When the initializer is removed we don't actually clear the
250+
// TODO: Don't remove the initializer in the rest of the compiler:
251+
// Search for "When the initializer is removed we don't actually clear the
252252
// pointer" because we do!
253253
return initAsWrittenWhenCreated->getSourceRange();
254254
}

0 commit comments

Comments
 (0)