File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1033,7 +1033,12 @@ void IRGenModule::addLinkLibrary(const LinkLibrary &linkLib) {
1033
1033
}
1034
1034
}
1035
1035
1036
- if (linkLib.shouldForceLoad ()) {
1036
+ // Don't emit the FORCE_LOAD symbols when the compiler is running
1037
+ // on behalf of the debugger. The debugger will read the LinkLibrary's
1038
+ // from all the modules it sees, and hand load all the required dependencies,
1039
+ // and since the symbol is weak it doesn't even tell us whether a
1040
+ // required dependency is missing. So it serves no purpose in this case.
1041
+ if (linkLib.shouldForceLoad () && !Context.LangOpts .DebuggerSupport ) {
1037
1042
llvm::SmallString<64 > buf;
1038
1043
encodeForceLoadSymbolName (buf, linkLib.getName ());
1039
1044
auto ForceImportThunk =
Original file line number Diff line number Diff line change 15
15
// RUN: %FileCheck %s < %t/force-load.txt
16
16
// RUN: %FileCheck -check-prefix FORCE-LOAD-CLIENT -check-prefix FORCE-LOAD-CLIENT-%target-object-format %s < %t/force-load.txt
17
17
18
+ // RUN: %target-swift-frontend -runtime-compatibility-version none -emit-ir -debugger-support -lmagic %s -I %t > %t/force-load.txt
19
+ // RUN: %FileCheck %s < %t/force-load.txt
20
+ // RUN: %FileCheck -check-prefix NO-FORCE-LOAD-CLIENT %s < %t/force-load.txt
21
+
18
22
// RUN: %target-swift-frontend -disable-autolinking-runtime-compatibility-dynamic-replacements -runtime-compatibility-version none -emit-ir -parse-stdlib -module-name someModule -module-link-name module %S/../Inputs/empty.swift | %FileCheck --check-prefix=NO-FORCE-LOAD %s
19
23
// RUN: %target-swift-frontend -runtime-compatibility-version none -emit-ir -parse-stdlib -module-name someModule -module-link-name module %S/../Inputs/empty.swift -autolink-force-load | %FileCheck --check-prefix=FORCE-LOAD %s
20
24
// RUN: %target-swift-frontend -runtime-compatibility-version none -emit-ir -parse-stdlib -module-name someModule -module-link-name 0module %S/../Inputs/empty.swift -autolink-force-load | %FileCheck --check-prefix=FORCE-LOAD-HEX %s
@@ -42,6 +46,7 @@ import someModule
42
46
// FORCE-LOAD-HEX: ret void
43
47
// FORCE-LOAD-HEX: }
44
48
49
+ // NO-FORCE-LOAD-CLIENT-NOT: FORCE_LOAD
45
50
// FORCE-LOAD-CLIENT: @"_swift_FORCE_LOAD_$_module_$_autolinking" = weak_odr hidden constant void ()* @"_swift_FORCE_LOAD_$_module"
46
51
// FORCE-LOAD-CLIENT: @llvm.used = appending global [{{[0-9]+}} x i8*] [
47
52
// FORCE-LOAD-CLIENT: i8* bitcast (void ()** @"_swift_FORCE_LOAD_$_module_$_autolinking" to i8*)
You can’t perform that action at this time.
0 commit comments