Skip to content

Commit b889e7e

Browse files
Janosch Hildebrandjrose-apple
authored andcommitted
[IRGen] Request LLDB specific tuning for all targets. (#5971)
Previously the default was used, implying LLDB specific tuning only for Darwin targets.
1 parent a13c134 commit b889e7e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/IRGen/IRGen.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ swift::getIRTargetOptions(IRGenOptions &Opts, ASTContext &Ctx) {
127127
// FIXME: We should do this entirely through Clang, for consistency.
128128
TargetOptions TargetOpts;
129129

130+
// Explicitly request debugger tuning for LLDB which is the default
131+
// on Darwin platforms but not on others.
132+
TargetOpts.DebuggerTuning = llvm::DebuggerKind::LLDB;
133+
130134
auto *Clang = static_cast<ClangImporter *>(Ctx.getClangModuleLoader());
131135
clang::TargetOptions &ClangOpts = Clang->getTargetInfo().getTargetOpts();
132136
return std::make_tuple(TargetOpts, ClangOpts.CPU, ClangOpts.Features);

test/DebugInfo/sdk.swift renamed to test/DebugInfo/compiler-flags.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@
1111
// CHECK-EXPLICIT-SAME: -sdk \22/Weird Location/SDK\22
1212
// CHECK-EXPLICIT-NOT: "
1313
// CHECK-EXPLICIT-SAME: -resource-dir
14+
15+
16+
// Check that we tune the debug output for LLDB.
17+
// Adapted from llvm/test/DebugInfo/X86/debugger-tune.ll
18+
// RUN: %target-swiftc_driver -emit-object -g %s -o %t
19+
// RUN: llvm-readobj -sections %t | %FileCheck --check-prefix=CHECK-LLDB %s
20+
21+
// CHECK-LLDB-NOT: debug_pubnames
22+
// CHECK-LLDB: apple_names
23+
// CHECK-LLDB-NOT: debug_pubnames

0 commit comments

Comments
 (0)