Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/IRGen/IRGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ swift::getIRTargetOptions(IRGenOptions &Opts, ASTContext &Ctx) {
// FIXME: We should do this entirely through Clang, for consistency.
TargetOptions TargetOpts;

// Explicitly request debugger tuning for LLDB which is the default
// on Darwin platforms but not on others.
TargetOpts.DebuggerTuning = llvm::DebuggerKind::LLDB;

auto *Clang = static_cast<ClangImporter *>(Ctx.getClangModuleLoader());
clang::TargetOptions &ClangOpts = Clang->getTargetInfo().getTargetOpts();
return std::make_tuple(TargetOpts, ClangOpts.CPU, ClangOpts.Features);
Expand Down
10 changes: 10 additions & 0 deletions test/DebugInfo/sdk.swift → test/DebugInfo/compiler-flags.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@
// CHECK-EXPLICIT-SAME: -sdk \22/Weird Location/SDK\22
// CHECK-EXPLICIT-NOT: "
// CHECK-EXPLICIT-SAME: -resource-dir


// Check that we tune the debug output for LLDB.
// Adapted from llvm/test/DebugInfo/X86/debugger-tune.ll
// RUN: %target-swiftc_driver -emit-object -g %s -o %t
// RUN: llvm-readobj -sections %t | %FileCheck --check-prefix=CHECK-LLDB %s

// CHECK-LLDB-NOT: debug_pubnames
// CHECK-LLDB: apple_names
// CHECK-LLDB-NOT: debug_pubnames