Commit c8f8817
committed
IRGen: attribute correct linkage to Windows DSO handle
Partially address the incorrect handling for the `#dsohandle` on
Windows.
We were previously emitting a local definition for this external
constant, and worse yet, not marking the definition for COMDAT. It is
unclear what definition would win ultimately (implementation defined),
as we had a definition as well as the linker synthesized value. We can
change the SIL linkage for this type to `DefaultForDeclaration` which
will give it `available_externally` and default visibility and storage
which is closer to what we desire. However, because we do not track the
LLVM variables and apply heuristics for lowering the
`SILGlobalVariable`, we would attribute it with imported DLL Storage.
This would then cause us to fail at link time (amusingly enough link.exe
will report a LNK1000). Special case the variable and track that we are
targeting a windows environment in the `UniversalLinkageInfo` so that we
do not special case this on other platforms.
This also has the nice side effect of allowing us to remove the special
case in the TBD handling.
Fixes: #647411 parent 07efa25 commit c8f8817
File tree
5 files changed
+23
-39
lines changed- include/swift/IRGen
- lib
- FrontendTool
- IRGen
- SILGen
5 files changed
+23
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | 59 | | |
82 | 60 | | |
83 | 61 | | |
| |||
99 | 77 | | |
100 | 78 | | |
101 | 79 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | 80 | | |
108 | 81 | | |
109 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2167 | 2167 | | |
2168 | 2168 | | |
2169 | 2169 | | |
2170 | | - | |
2171 | | - | |
2172 | | - | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
2173 | 2173 | | |
2174 | 2174 | | |
2175 | 2175 | | |
2176 | 2176 | | |
2177 | 2177 | | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
2178 | 2184 | | |
2179 | 2185 | | |
2180 | 2186 | | |
| |||
2208 | 2214 | | |
2209 | 2215 | | |
2210 | 2216 | | |
2211 | | - | |
| 2217 | + | |
2212 | 2218 | | |
2213 | 2219 | | |
2214 | 2220 | | |
| |||
2262 | 2268 | | |
2263 | 2269 | | |
2264 | 2270 | | |
2265 | | - | |
2266 | | - | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
2267 | 2274 | | |
2268 | 2275 | | |
2269 | 2276 | | |
| |||
2297 | 2304 | | |
2298 | 2305 | | |
2299 | 2306 | | |
2300 | | - | |
2301 | | - | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
2302 | 2310 | | |
2303 | 2311 | | |
2304 | 2312 | | |
| |||
2308 | 2316 | | |
2309 | 2317 | | |
2310 | 2318 | | |
2311 | | - | |
2312 | | - | |
| 2319 | + | |
| 2320 | + | |
2313 | 2321 | | |
2314 | 2322 | | |
2315 | 2323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4163 | 4163 | | |
4164 | 4164 | | |
4165 | 4165 | | |
4166 | | - | |
4167 | | - | |
| 4166 | + | |
| 4167 | + | |
| 4168 | + | |
4168 | 4169 | | |
4169 | 4170 | | |
4170 | 4171 | | |
| |||
0 commit comments