std::unique_ptr<DWARFDebugMacro> Macro;
std::unique_ptr<DWARFAcceleratorTable> AppleNames;
std::unique_ptr<DWARFAcceleratorTable> AppleTypes;
+ std::unique_ptr<DWARFAcceleratorTable> AppleNamespaces;
+ std::unique_ptr<DWARFAcceleratorTable> AppleObjC;
DWARFUnitSection<DWARFCompileUnit> DWOCUs;
std::deque<DWARFUnitSection<DWARFTypeUnit>> DWOTUs;
/// Get a reference to the parsed accelerator table object.
const DWARFAcceleratorTable &getAppleTypes();
+ /// Get a reference to the parsed accelerator table object.
+ const DWARFAcceleratorTable &getAppleNamespaces();
+
+ /// Get a reference to the parsed accelerator table object.
+ const DWARFAcceleratorTable &getAppleObjC();
+
/// Get a pointer to a parsed line table corresponding to a compile unit.
const DWARFDebugLine::LineTable *getLineTableForUnit(DWARFUnit *cu);
DWARFContext::~DWARFContext() = default;
-static void dumpAccelSection(raw_ostream &OS, const DWARFObject &Obj,
- const DWARFSection &Section,
- StringRef StringSection, bool LittleEndian) {
- DWARFDataExtractor AccelSection(Obj, Section, LittleEndian, 0);
- DataExtractor StrData(StringSection, LittleEndian, 0);
- DWARFAcceleratorTable Accel(AccelSection, StrData);
- if (!Accel.extract())
- return;
- Accel.dump(OS);
-}
-
/// Dump the UUID load command.
static void dumpUUID(raw_ostream &OS, const ObjectFile &Obj) {
auto *MachO = dyn_cast<MachOObjectFile>(&Obj);
if (shouldDump(Explicit, ".apple_namespaces", DIDT_ID_AppleNamespaces,
DObj->getAppleNamespacesSection().Data))
- dumpAccelSection(OS, *DObj, DObj->getAppleNamespacesSection(),
- DObj->getStringSection(), isLittleEndian());
+ getAppleNamespaces().dump(OS);
if (shouldDump(Explicit, ".apple_objc", DIDT_ID_AppleObjC,
DObj->getAppleObjCSection().Data))
- dumpAccelSection(OS, *DObj, DObj->getAppleObjCSection(),
- DObj->getStringSection(), isLittleEndian());
+ getAppleObjC().dump(OS);
}
DWARFCompileUnit *DWARFContext::getDWOCompileUnitForHash(uint64_t Hash) {
DObj->getStringSection(), isLittleEndian());
}
+const DWARFAcceleratorTable &DWARFContext::getAppleNamespaces() {
+ return getAccelTable(AppleNamespaces, *DObj,
+ DObj->getAppleNamespacesSection(),
+ DObj->getStringSection(), isLittleEndian());
+}
+
+const DWARFAcceleratorTable &DWARFContext::getAppleObjC() {
+ return getAccelTable(AppleObjC, *DObj, DObj->getAppleObjCSection(),
+ DObj->getStringSection(), isLittleEndian());
+}
+
const DWARFLineTable *
DWARFContext::getLineTableForUnit(DWARFUnit *U) {
if (!Line)