diff --git a/lib/IRGen/IRGen.cpp b/lib/IRGen/IRGen.cpp index ac6deac8631ed..c19419ffcef63 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -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(Ctx.getClangModuleLoader()); clang::TargetOptions &ClangOpts = Clang->getTargetInfo().getTargetOpts(); return std::make_tuple(TargetOpts, ClangOpts.CPU, ClangOpts.Features); diff --git a/test/DebugInfo/sdk.swift b/test/DebugInfo/compiler-flags.swift similarity index 69% rename from test/DebugInfo/sdk.swift rename to test/DebugInfo/compiler-flags.swift index f7a0b0700d1fc..affcc6fcefe9a 100644 --- a/test/DebugInfo/sdk.swift +++ b/test/DebugInfo/compiler-flags.swift @@ -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