summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 3ee78710e8f..b1703e9a46a 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -192,6 +192,14 @@ struct SymbolCU {
DwarfCompileUnit *CU;
};
+/// The kind of accelerator tables we should emit.
+enum class AccelTableKind {
+ Default, ///< Platform default.
+ None, ///< None.
+ Apple, ///< .apple_names, .apple_namespaces, .apple_types, .apple_objc.
+ Dwarf, ///< DWARF v5 .debug_names.
+};
+
/// Collects and handles dwarf debug information.
class DwarfDebug : public DebugHandlerBase {
/// All DIEValues are allocated through this allocator.
@@ -270,7 +278,7 @@ class DwarfDebug : public DebugHandlerBase {
/// DWARF5 Experimental Options
/// @{
- bool HasDwarfAccelTables;
+ AccelTableKind AccelTableKind;
bool HasAppleExtensionAttributes;
bool HasSplitDwarf;
@@ -302,7 +310,8 @@ class DwarfDebug : public DebugHandlerBase {
AddressPool AddrPool;
- /// Apple accelerator tables.
+ /// Accelerator tables.
+ AccelTable<DWARF5AccelTableData> AccelDebugNames;
AccelTable<AppleAccelTableOffsetData> AccelNames;
AccelTable<AppleAccelTableOffsetData> AccelObjC;
AccelTable<AppleAccelTableOffsetData> AccelNamespace;
@@ -351,6 +360,9 @@ class DwarfDebug : public DebugHandlerBase {
template <typename AccelTableT>
void emitAccel(AccelTableT &Accel, MCSection *Section, StringRef TableName);
+ /// Emit DWARF v5 accelerator table.
+ void emitAccelDebugNames();
+
/// Emit visible names into a hashed accelerator table section.
void emitAccelNames();
@@ -523,9 +535,8 @@ public:
// Experimental DWARF5 features.
- /// Returns whether or not to emit tables that dwarf consumers can
- /// use to accelerate lookup.
- bool useDwarfAccelTables() const { return HasDwarfAccelTables; }
+ /// Returns what kind (if any) of accelerator tables to emit.
+ llvm::AccelTableKind getAccelTableKind() const { return AccelTableKind; }
bool useAppleExtensionAttributes() const {
return HasAppleExtensionAttributes;
@@ -590,6 +601,9 @@ public:
/// Find the matching DwarfCompileUnit for the given CU DIE.
DwarfCompileUnit *lookupCU(const DIE *Die) { return CUDieMap.lookup(Die); }
+ const DwarfCompileUnit *lookupCU(const DIE *Die) const {
+ return CUDieMap.lookup(Die);
+ }
/// \defgroup DebuggerTuning Predicates to tune DWARF for a given debugger.
///
OpenPOWER on IntegriCloud