AST: Accessors no longer appear as members of their parent DeclContext

Accessors logically belong to their storage and can be synthesized
on the fly, so removing them from the members list eliminates one
source of mutability (but doesn't eliminate it; there are also
witnesses for derived conformances, and implicit constructors).

Since a few ASTWalker implementations break in non-trivial ways when
the traversal is changed to visit accessors as children of the storage
rather than peers, I hacked up the ASTWalker to optionally preserve
the old traversal order for now. This is ugly and needs to be cleaned up,
but I want to avoid breaking _too_ much with this commit.
This commit is contained in:
Slava Pestov
2019-07-24 21:41:59 -04:00
parent d3cd9c2d7b
commit 1ee2db4520
32 changed files with 253 additions and 278 deletions

View File

@@ -182,7 +182,6 @@ static ValueDecl *deriveProperty(DerivedConformance &derived, Type type,
synthesizer(getterDecl);
auto *dc = cast<IterableDeclContext>(derived.ConformanceDecl);
dc->addMember(getterDecl);
dc->addMember(propDecl);
dc->addMember(pbDecl);
return propDecl;