swift
c8f88175 - IRGen: attribute correct linkage to Windows DSO handle

Commit
3 years ago
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: #64741
Author
Committer
Parents
Loading