Skip to content

Commit c83f65f

Browse files
committed
IRGen: address TODO for Windows static linking
This improves the static linking story on Windows by wiring up information about the static vs dynamic build of the module into the code generation for references to module external symbols. We now can indicate a module external symbol to be known local if it is expected to be internalized due to static linking. Even though the symbol may not be defined in the same module, the definition will be provided locally at link time. This avoids needing to resolve a dllimport'ed symbol to a local symbol at link time.
1 parent e35261f commit c83f65f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,11 +2212,9 @@ LinkInfo LinkInfo::get(const UniversalLinkageInfo &linkInfo, StringRef name,
22122212
SILLinkage linkage, ForDefinition_t isDefinition,
22132213
bool isWeakImported) {
22142214
LinkInfo result;
2215-
2216-
// TODO(compnerd) handle this properly
2217-
22182215
result.Name += name;
2219-
result.IRL = getIRLinkage(linkInfo, linkage, isDefinition, isWeakImported);
2216+
result.IRL = getIRLinkage(linkInfo, linkage, isDefinition, isWeakImported,
2217+
linkInfo.Internalize);
22202218
result.ForDefinition = isDefinition;
22212219
return result;
22222220
}

0 commit comments

Comments
 (0)