File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1903,6 +1903,8 @@ Address IRGenModule::getAddrOfSILGlobalVariable(SILGlobalVariable *var,
1903
1903
// / Add a zero initializer.
1904
1904
if (forDefinition)
1905
1905
gvar->setInitializer (llvm::Constant::getNullValue (storageTypeWithContainer));
1906
+ else
1907
+ gvar->setComdat (nullptr );
1906
1908
}
1907
1909
llvm::Constant *addr = gvar;
1908
1910
if (var->isInitializedObject ()) {
@@ -2184,8 +2186,11 @@ llvm::Function *IRGenModule::getAddrOfSILFunction(
2184
2186
// associated with it. The combination of the two allows us to identify the
2185
2187
// @_silgen_name functions. These are locally defined function thunks used in
2186
2188
// the standard library. Do not give them DLLImport DLL Storage.
2187
- if (useDllStorage () && f->hasCReferences () && !forDefinition)
2188
- fn->setDLLStorageClass (llvm::GlobalValue::DefaultStorageClass);
2189
+ if (!forDefinition) {
2190
+ fn->setComdat (nullptr );
2191
+ if (f->hasCReferences ())
2192
+ fn->setDLLStorageClass (llvm::GlobalValue::DefaultStorageClass);
2193
+ }
2189
2194
2190
2195
// If we have an order number for this function, set it up as appropriate.
2191
2196
if (hasOrderNumber) {
You can’t perform that action at this time.
0 commit comments