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 @@ -1075,6 +1075,7 @@ struct IRLinkage {
1075
1075
static const IRLinkage Internal;
1076
1076
1077
1077
static const IRLinkage ExternalImport;
1078
+ static const IRLinkage ExternalWeakImport;
1078
1079
static const IRLinkage ExternalExport;
1079
1080
};
1080
1081
Original file line number Diff line number Diff line change @@ -981,7 +981,7 @@ void IRGenModule::addLinkLibrary(const LinkLibrary &linkLib) {
981
981
encodeForceLoadSymbolName (buf, linkLib.getName ());
982
982
auto ForceImportThunk =
983
983
Module.getOrInsertFunction (buf, llvm::FunctionType::get (VoidTy, false ));
984
- ApplyIRLinkage (IRLinkage::ExternalImport )
984
+ ApplyIRLinkage (IRLinkage::ExternalWeakImport )
985
985
.to (cast<llvm::GlobalValue>(ForceImportThunk));
986
986
987
987
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 @@ -49,5 +49,5 @@ import someModule
49
49
// FORCE-LOAD-CLIENT: @llvm.used = appending global [{{[0-9]+}} x i8*] [
50
50
// FORCE-LOAD-CLIENT: i8* bitcast (void ()** @"_swift_FORCE_LOAD_$_module_$_autolinking" to i8*)
51
51
// FORCE-LOAD-CLIENT: ], section "llvm.metadata"
52
- // FORCE-LOAD-CLIENT: declare {{(dllimport )?}}void @"_swift_FORCE_LOAD_$_module"()
52
+ // FORCE-LOAD-CLIENT: declare extern_weak {{(dllimport )?}}void @"_swift_FORCE_LOAD_$_module"()
53
53
You can’t perform that action at this time.
0 commit comments