File tree Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1127,6 +1127,7 @@ struct IRLinkage {
1127
1127
static const IRLinkage Internal;
1128
1128
1129
1129
static const IRLinkage ExternalImport;
1130
+ static const IRLinkage ExternalWeakImport;
1130
1131
static const IRLinkage ExternalExport;
1131
1132
};
1132
1133
Original file line number Diff line number Diff line change @@ -985,7 +985,7 @@ void IRGenModule::addLinkLibrary(const LinkLibrary &linkLib) {
985
985
encodeForceLoadSymbolName (buf, linkLib.getName ());
986
986
auto ForceImportThunk =
987
987
Module.getOrInsertFunction (buf, llvm::FunctionType::get (VoidTy, false ));
988
- ApplyIRLinkage (IRLinkage::ExternalImport )
988
+ ApplyIRLinkage (IRLinkage::ExternalWeakImport )
989
989
.to (cast<llvm::GlobalValue>(ForceImportThunk));
990
990
991
991
buf += " _$" ;
Original file line number Diff line number Diff line change @@ -57,6 +57,12 @@ const IRLinkage IRLinkage::ExternalImport = {
57
57
llvm::GlobalValue::DLLImportStorageClass,
58
58
};
59
59
60
+ const IRLinkage IRLinkage::ExternalWeakImport = {
61
+ llvm::GlobalValue::ExternalWeakLinkage,
62
+ llvm::GlobalValue::DefaultVisibility,
63
+ llvm::GlobalValue::DLLImportStorageClass,
64
+ };
65
+
60
66
const IRLinkage IRLinkage::ExternalExport = {
61
67
llvm::GlobalValue::ExternalLinkage,
62
68
llvm::GlobalValue::DefaultVisibility,
Original file line number Diff line number Diff line change @@ -46,5 +46,5 @@ import someModule
46
46
// FORCE-LOAD-CLIENT: @llvm.used = appending global [{{[0-9]+}} x i8*] [
47
47
// FORCE-LOAD-CLIENT: i8* bitcast (void ()** @"_swift_FORCE_LOAD_$_module_$_autolinking" to i8*)
48
48
// FORCE-LOAD-CLIENT: ], section "llvm.metadata"
49
- // FORCE-LOAD-CLIENT: declare {{(dllimport )?}}void @"_swift_FORCE_LOAD_$_module"()
49
+ // FORCE-LOAD-CLIENT: declare extern_weak {{(dllimport )?}}void @"_swift_FORCE_LOAD_$_module"()
50
50
You can’t perform that action at this time.
0 commit comments