Skip to content

[AST] Adopt SubstitutionMap as the storage mechanism for substitutions #16268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

DougGregor
Copy link
Member

Start adopting SubstitutionMap as the storage mechanism for substitutions, replacing instances of SubstitutionList within AST nodes (and some APIs) with the uniqued, ASTContext-allocated SubstitutionMap. Specifically:

  • Make SubstitutionMap (de-)serializable, so we can easily embed a substitution map in the on-disk layout of an AST node
  • Switch NameAliasType over to storing a SubstitutionMap; eliminate corresponding SubstitutionList APIs.

Allow substitution maps to be serialized directly (via an ID), writing out
the replacement types and conformances as appropriate. This is a more
efficient form of serialization than the current SubstitutionList approach,
because it maintains uniqueness of substitution maps within a module file,
and is a step toward eliminating SubstitutionList entirely.
Convert NameAliasType’s internal representation from tail-allocating an
array of Substitutions (to be treated as a SubstitutionList) to store a
single SubstitutionMap. Serialize using that SubstitutionMap.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@shahmishal
Copy link
Member

@swift-ci please smoke test Linux

@DougGregor DougGregor merged commit 6bdd24d into swiftlang:master May 1, 2018
@DougGregor DougGregor deleted the substitution-map-ast-adoption branch May 1, 2018 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants