[IRGen] Make pointers to accessor functions in layout strings relative (#64155)

* [IRGen] Make pointers to accessor functions in layout strings relative

rdar://106319336

Pointers embedded in static layout strings should always be relative, so layout strings can reside in read-only memory.

* Properly handle reference storage ownership

* Pass layout tag and metadata / type layout ppointers separately

* Layout string instantiation fully working

* Fix cases where hasLayoutString flag was not set when it should have

* Update include/swift/ABI/Metadata.h
This commit is contained in:
Dario Rexin
2023-03-17 09:02:51 -07:00
committed by GitHub
parent e8be44d14e
commit 2f8c1a402c
13 changed files with 528 additions and 525 deletions

View File

@@ -153,12 +153,12 @@ CastsTests.test("Cast from Swift existential to Protocol") {
/// test these paths on Linux as well.
protocol P4 {}
CastsTests.test("struct -> Obj-C -> Protocol") {
struct S: P4 {
struct SFUUUHREEEEEFFFF: P4 {
let value: Int
let tracker = LifetimeTracked(13)
}
let a: P4 = S(value: 13)
let a: P4 = SFUUUHREEEEEFFFF(value: 13)
let b = _bridgeAnythingToObjectiveC(a)
let d = b as? Any