//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_DEBUGINFO_DWARFUNIT_H
-#define LLVM_DEBUGINFO_DWARFUNIT_H
+#ifndef LLVM_LIB_DEBUGINFO_DWARFUNIT_H
+#define LLVM_LIB_DEBUGINFO_DWARFUNIT_H
#include "DWARFDebugAbbrev.h"
#include "DWARFDebugInfoEntry.h"
class ObjectFile;
}
+class DWARFContext;
class DWARFDebugAbbrev;
class StringRef;
class raw_ostream;
class DWARFUnit {
+ DWARFContext &Context;
+
const DWARFDebugAbbrev *Abbrev;
StringRef InfoSection;
StringRef RangeSection;
std::unique_ptr<DWARFContext> DWOContext;
DWARFUnit *DWOU;
public:
- DWOHolder(object::ObjectFile *DWOFile);
+ DWOHolder(std::unique_ptr<object::ObjectFile> DWOFile);
DWARFUnit *getUnit() const { return DWOU; }
};
std::unique_ptr<DWOHolder> DWO;
virtual uint32_t getHeaderSize() const { return 11; }
public:
- DWARFUnit(const DWARFDebugAbbrev *DA, StringRef IS, StringRef RS,
- StringRef SS, StringRef SOS, StringRef AOS, const RelocAddrMap *M,
- bool LE);
+ DWARFUnit(DWARFContext& Context, const DWARFDebugAbbrev *DA, StringRef IS,
+ StringRef RS, StringRef SS, StringRef SOS, StringRef AOS,
+ const RelocAddrMap *M, bool LE);
virtual ~DWARFUnit();
+ DWARFContext& getContext() const { return Context; }
+
StringRef getStringSection() const { return StringSection; }
StringRef getStringOffsetSection() const { return StringOffsetSection; }
void setAddrOffsetSection(StringRef AOS, uint32_t Base) {