Skip to content

New SubstitutionMap data structure #4685

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
merged 3 commits into from
Sep 9, 2016

Conversation

slavapestov
Copy link
Contributor

No description provided.

This replaces the TypeSubstitutionMap / ConformanceMap pair that
has been appearing more and more lately.
This variant looks up conformances in a ConformanceMap rather than
in the module. Avoiding blind conformance lookups is good for two
reasons:

- for general robustness at the SIL level, we prefer to use
  conformances handed to us by Sema rather than doing lookups,
  because that way we are guaranteed to receive a complete
  conformance. We've had several tricky bugs where SIL looks up
  a conformance that has not been forced by Sema, and this new
  variant of subst() defines the problem out of existence.

- with property behaviors, the conformance cannot be looked up
  in this manner at all, so there we *must* always use a
  conformance map, if one is given.

- the old API required passing in a ModuleDecl *, which is
  awkward.
SILType substitutions are still done with the old form, and until
BoundGenericTypes hold conformances, we still have to pass around
a ModuleDecl in a few places we really shouldn't, but one step
at a time.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 4ab09b4 into swiftlang:master Sep 9, 2016
@slavapestov slavapestov deleted the add-substitution-map branch September 9, 2016 08:18
aaditya-chandrasekhar pushed a commit to val-verde/swift that referenced this pull request Sep 30, 2022
[pull] swiftwasm-release/5.7 from release/5.7
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.

1 participant