Commit b4673a2
committed
[cxx-interop][IRGen] Emit type metadata accessors correctly
This change makes sure we correctly emit IR for type metadata accessors for C++ reference types.
This fixes linker errors when a type metadata of a C++ reference type is used in multiple object files that are later linked together, for instance, if a C++ reference type is conformed to different Swift protocols in different Swift source files:
```
duplicate symbol 'type metadata accessor for __C.SharedObject' in:
main.o
second.o
ld: 1 duplicate symbols
```
rdar://129027705
(cherry picked from commit a5ce0dc)1 parent a65733c commit b4673a2
File tree
2 files changed
+17
-3
lines changed- lib/IRGen
- test/Interop/Cxx/foreign-reference
2 files changed
+17
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1112 | 1112 | | |
1113 | 1113 | | |
1114 | 1114 | | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | 1115 | | |
1119 | 1116 | | |
1120 | 1117 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments