Changeset View
Changeset View
Standalone View
Standalone View
lib/CodeGen/AsmPrinter/DwarfDebug.h
Show All 27 Lines | |||||
#include "llvm/CodeGen/DIE.h" | #include "llvm/CodeGen/DIE.h" | ||||
#include "llvm/CodeGen/LexicalScopes.h" | #include "llvm/CodeGen/LexicalScopes.h" | ||||
#include "llvm/CodeGen/MachineInstr.h" | #include "llvm/CodeGen/MachineInstr.h" | ||||
#include "llvm/IR/DebugInfo.h" | #include "llvm/IR/DebugInfo.h" | ||||
#include "llvm/IR/DebugLoc.h" | #include "llvm/IR/DebugLoc.h" | ||||
#include "llvm/MC/MCDwarf.h" | #include "llvm/MC/MCDwarf.h" | ||||
#include "llvm/MC/MachineLocation.h" | #include "llvm/MC/MachineLocation.h" | ||||
#include "llvm/Support/Allocator.h" | #include "llvm/Support/Allocator.h" | ||||
#include "llvm/Target/TargetMachine.h" | |||||
#include "llvm/Target/TargetOptions.h" | |||||
#include <memory> | #include <memory> | ||||
namespace llvm { | namespace llvm { | ||||
class AsmPrinter; | class AsmPrinter; | ||||
class ByteStreamer; | class ByteStreamer; | ||||
class ConstantInt; | class ConstantInt; | ||||
class ConstantFP; | class ConstantFP; | ||||
▲ Show 20 Lines • Show All 266 Lines • ▼ Show 20 Lines | class DwarfDebug : public AsmPrinterHandler { | ||||
// FIXME: replace this with a map from comp_dir to table so that we can emit | // FIXME: replace this with a map from comp_dir to table so that we can emit | ||||
// multiple tables during LTO each of which uses directory 0, referencing the | // multiple tables during LTO each of which uses directory 0, referencing the | ||||
// comp_dir of all the type units that use it. | // comp_dir of all the type units that use it. | ||||
MCDwarfDwoLineTable SplitTypeUnitFileTable; | MCDwarfDwoLineTable SplitTypeUnitFileTable; | ||||
// True iff there are multiple CUs in this module. | // True iff there are multiple CUs in this module. | ||||
bool SingleCU; | bool SingleCU; | ||||
bool IsDarwin; | bool IsDarwin; | ||||
bool IsPS4; | |||||
AddressPool AddrPool; | AddressPool AddrPool; | ||||
DwarfAccelTable AccelNames; | DwarfAccelTable AccelNames; | ||||
DwarfAccelTable AccelObjC; | DwarfAccelTable AccelObjC; | ||||
DwarfAccelTable AccelNamespace; | DwarfAccelTable AccelNamespace; | ||||
DwarfAccelTable AccelTypes; | DwarfAccelTable AccelTypes; | ||||
▲ Show 20 Lines • Show All 205 Lines • ▼ Show 20 Lines | public: | ||||
void setSymbolSize(const MCSymbol *Sym, uint64_t Size) override { | void setSymbolSize(const MCSymbol *Sym, uint64_t Size) override { | ||||
SymSize[Sym] = Size; | SymSize[Sym] = Size; | ||||
} | } | ||||
/// \brief Returns whether to use DW_OP_GNU_push_tls_address, instead of the | /// \brief Returns whether to use DW_OP_GNU_push_tls_address, instead of the | ||||
/// standard DW_OP_form_tls_address opcode | /// standard DW_OP_form_tls_address opcode | ||||
bool useGNUTLSOpcode() const { return UseGNUTLSOpcode; } | bool useGNUTLSOpcode() const { return UseGNUTLSOpcode; } | ||||
// 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. | |||||
// | |||||
/// \defgroup DebuggerTuning Predicates to tune DWARF for a given debugger. | |||||
/// | |||||
/// The "tuning" predicates 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. | |||||
/// @{ | |||||
echristo: This could all go with the enum. | |||||
bool tuneDebugForGDB() const { | |||||
return Asm->TM.Options.DebuggerTuning == DebuggerKind::GDB; | |||||
} | |||||
Possibly rename without using Debug. We're in the debug code already. echristo: Possibly rename without using Debug. We're in the debug code already. | |||||
bool tuneDebugForLLDB() const { | |||||
return Asm->TM.Options.DebuggerTuning == DebuggerKind::LLDB; | |||||
} | |||||
bool tuneDebugForSCE() const { | |||||
return Asm->TM.Options.DebuggerTuning == DebuggerKind::SCE; | |||||
} | |||||
/// @} | |||||
// Experimental DWARF5 features. | // Experimental DWARF5 features. | ||||
/// \brief Returns whether or not to emit tables that dwarf consumers can | /// \brief Returns whether or not to emit tables that dwarf consumers can | ||||
/// use to accelerate lookup. | /// use to accelerate lookup. | ||||
bool useDwarfAccelTables() const { return HasDwarfAccelTables; } | bool useDwarfAccelTables() const { return HasDwarfAccelTables; } | ||||
/// \brief Returns whether or not to change the current debug info for the | /// \brief Returns whether or not to change the current debug info for the | ||||
/// split dwarf proposal support. | /// split dwarf proposal support. | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |
This could all go with the enum.