#include "DIE.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/FoldingSet.h"
+#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringMap.h"
class MCObjectFileInfo;
class DIEAbbrev;
class DIE;
-class DIEBlock;
+class DIELoc;
class DIEEntry;
//===----------------------------------------------------------------------===//
unsigned NextStringPoolNumber;
std::string StringPref;
+ struct AddressPoolEntry {
+ unsigned Number;
+ bool TLS;
+ AddressPoolEntry(unsigned Number, bool TLS) : Number(Number), TLS(TLS) {}
+ };
// Collection of addresses for this unit and assorted labels.
// A Symbol->unsigned mapping of addresses used by indirect
// references.
- typedef DenseMap<const MCExpr *, unsigned> AddrPool;
+ typedef DenseMap<const MCSymbol *, AddressPoolEntry> AddrPool;
AddrPool AddressPool;
unsigned NextAddrPoolNumber;
/// \brief Returns the index into the address pool with the given
/// label/symbol.
- unsigned getAddrPoolIndex(const MCExpr *Sym);
- unsigned getAddrPoolIndex(const MCSymbol *Sym);
+ unsigned getAddrPoolIndex(const MCSymbol *Sym, bool TLS = false);
/// \brief Returns the address pool.
AddrPool *getAddrPool() { return &AddressPool; }
DwarfCompileUnit *FirstCU;
// Maps MDNode with its corresponding DwarfCompileUnit.
- DenseMap<const MDNode *, DwarfCompileUnit *> CUMap;
+ MapVector<const MDNode *, DwarfCompileUnit *> CUMap;
// Maps subprogram MDNode with its corresponding DwarfCompileUnit.
DenseMap<const MDNode *, DwarfCompileUnit *> SPMap;
// Whether to emit the pubnames/pubtypes sections.
bool HasDwarfPubSections;
+ // Whether or not to use AT_ranges for compilation units.
+ bool HasCURanges;
+
+ // Whether we emitted a function into a section other than the default
+ // text.
+ bool UsedNonDefaultText;
+
// Version of dwarf we're emitting.
unsigned DwarfVersion;
/// DWARF 5 Experimental Split Dwarf Emitters
+ /// \brief Initialize common features of skeleton units.
+ void initSkeletonUnit(const DwarfUnit *U, DIE *Die, DwarfUnit *NewU);
+
/// \brief Construct the split debug info compile unit for the debug info
/// section.
DwarfCompileUnit *constructSkeletonCU(const DwarfCompileUnit *CU);
+ /// \brief Construct the split debug info compile unit for the debug info
+ /// section.
+ DwarfTypeUnit *constructSkeletonTU(DwarfTypeUnit *TU);
+
/// \brief Emit the debug info dwo section.
void emitDebugInfoDWO();
/// \brief Add a DIE to the set of types that we're going to pull into
/// type units.
- void addDwarfTypeUnitType(uint16_t Language, DIE *Die, DICompositeType CTy);
+ void addDwarfTypeUnitType(DwarfCompileUnit &CU, StringRef Identifier,
+ DIE *Die, DICompositeType CTy);
/// \brief Add a label so that arange data can be generated for it.
void addArangeLabel(SymbolCU SCU) { ArangeLabels.push_back(SCU); }
/// split dwarf proposal support.
bool useSplitDwarf() { return HasSplitDwarf; }
+ /// \brief Returns whether or not to use AT_ranges for compilation units.
+ bool useCURanges() { return HasCURanges; }
+
/// Returns the Dwarf Version.
unsigned getDwarfVersion() const { return DwarfVersion; }