mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The use of ASTContext-allocated arrays to store the members of nominal type declarations and the extensions thereof is an abomination. Instead, introduce the notion of an "iterable" declaration context, which keeps track of the declarations within that context (stored as a singly-linked list) and allows iteration over them. When a member is added, it will also make sure that the member goes into the lookup table for its context immediately. This eliminates a ton of wasted memory when we have to reallocate the members arrays for types and extensions, and moves us toward a much more sane model. The only functionality change here is that the Clang importer no longer puts subscript declarations into the wrong class, nor does it nested a C struct within another C struct. Swift SVN r16572
102 KiB
102 KiB