Skip to content

Commit cab3137

Browse files
committed
[IRGen] Request LLDB specific tuning for all targets.
Previously the default was used, implying LLDB specific tuning only for Darwin targets.
1 parent 0b34f20 commit cab3137

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
@@ -121,6 +121,10 @@ swift::getIRTargetOptions(IRGenOptions &Opts, ASTContext &Ctx) {
121121
// FIXME: We should do this entirely through Clang, for consistency.
122122
TargetOptions TargetOpts;
123123

124+
// Explicitly request debugger tuning for LLDB which is the default
125+
// on Darwin platforms but not on others.
126+
TargetOpts.DebuggerTuning = llvm::DebuggerKind::LLDB;
127+
124128
auto *Clang = static_cast<ClangImporter *>(Ctx.getClangModuleLoader());
125129
clang::TargetOptions &ClangOpts = Clang->getTargetInfo().getTargetOpts();
126130
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)