Commit a5ce0dc
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://1290277051 parent 67c0fd8 commit a5ce0dc
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 | |
|---|---|---|---|
| |||
1102 | 1102 | | |
1103 | 1103 | | |
1104 | 1104 | | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | 1105 | | |
1109 | 1106 | | |
1110 | 1107 | | |
| |||
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