forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IRGen: Use metadata accessors for types with resilient layout
If a struct has fixed layout but contains fields which are opaque, or if the struct itself is opaque, use a metadata accessor function instead of loading the metadata directly. Let's say that A and B are two structs defined in the same module, and B has a fixed size. This patch adds support for these two cases: 1) Fixed-layout struct A contains resilient struct B 2) Resilient struct A contains resilient struct B In case 1), a) Inside X: A is fixed-size and has constant metadata i) Direct metadata access can be performed on A and B ii) Direct field access can be performed on A and B d) Outside X: B has an opaque layout i) Metadata accessor must be called for A and B ii) Fields of A do not have constant offsets, instead the offsets must be loaded from type metadata Case 2) is the same as above except ii) does not apply, since fields of resilient structs are manipulated via accessors. Eventually, we will use metadata accessor functions for all public struct and enum types.
- Loading branch information
1 parent
72fa928
commit a05f6c8
Showing
7 changed files
with
222 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.