diff options
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 17 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 25 |
2 files changed, 4 insertions, 38 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 477ebe1d638..3466f3469f1 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -77,17 +77,6 @@ static cl::opt<bool> GenerateARangeSection("generate-arange-section", cl::desc("Generate dwarf aranges"), cl::init(false)); -static cl::opt<DebuggerKind> -DebuggerTuningOpt("debugger-tune", - cl::desc("Tune debug info for a particular debugger"), - cl::init(DebuggerKind::Default), - cl::values( - clEnumValN(DebuggerKind::GDB, "gdb", "gdb"), - clEnumValN(DebuggerKind::LLDB, "lldb", "lldb"), - clEnumValN(DebuggerKind::SCE, "sce", - "SCE targets (e.g. PS4)"), - clEnumValEnd)); - namespace { enum DefaultOnOff { Default, Enable, Disable }; } @@ -228,10 +217,10 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M) CurMI = nullptr; Triple TT(Asm->getTargetTriple()); - // Make sure we know our "debugger tuning." The command-line option takes + // Make sure we know our "debugger tuning." The target option takes // precedence; fall back to triple-based defaults. - if (DebuggerTuningOpt != DebuggerKind::Default) - DebuggerTuning = DebuggerTuningOpt; + if (Asm->TM.Options.DebuggerTuning != DebuggerKind::Default) + DebuggerTuning = Asm->TM.Options.DebuggerTuning; else if (IsDarwin || TT.isOSFreeBSD()) DebuggerTuning = DebuggerKind::LLDB; else if (TT.isPS4CPU()) diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index a0c60efd993..4c613a90545 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -33,6 +33,7 @@ #include "llvm/MC/MCDwarf.h" #include "llvm/MC/MachineLocation.h" #include "llvm/Support/Allocator.h" +#include "llvm/Target/TargetOptions.h" #include <memory> namespace llvm { @@ -186,30 +187,6 @@ struct SymbolCU { DwarfCompileUnit *CU; }; -/// Identify a debugger for "tuning" the debug info. -/// -/// The "debugger tuning" concept allows us to present a more intuitive -/// interface that unpacks into different sets of defaults for the various -/// individual feature-flag settings, that suit the preferences of the -/// various debuggers. However, it's worth remembering that debuggers are -/// not the only consumers of debug info, and some variations in DWARF might -/// better be treated as target/platform issues. Fundamentally, -/// o if the feature is useful (or not) to a particular debugger, regardless -/// of the target, that's a tuning decision; -/// o if the feature is useful (or not) on a particular platform, regardless -/// of the debugger, that's a target decision. -/// It's not impossible to see both factors in some specific case. -/// -/// The "tuning" should be used to set defaults for individual feature flags -/// in DwarfDebug; if a given feature has a more specific command-line option, -/// that option should take precedence over the tuning. -enum class DebuggerKind { - Default, // No specific tuning requested. - GDB, // Tune debug info for gdb. - LLDB, // Tune debug info for lldb. - SCE // Tune debug info for SCE targets (e.g. PS4). -}; - /// Collects and handles dwarf debug information. class DwarfDebug : public AsmPrinterHandler { /// Target of Dwarf emission. |