1 //===-- DWARFUnitIndex.h --------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_LIB_DEBUGINFO_DWARFUNITINDEX_H
11 #define LLVM_LIB_DEBUGINFO_DWARFUNITINDEX_H
13 #include "llvm/Support/DataExtractor.h"
14 #include "llvm/Support/Format.h"
15 #include "llvm/Support/raw_ostream.h"
20 enum DWARFSectionKind {
31 class DWARFUnitIndex {
36 uint32_t NumBuckets = 0;
38 bool parse(DataExtractor IndexData, uint32_t *OffsetPtr);
39 void dump(raw_ostream &OS) const;
45 struct SectionContribution {
51 const DWARFUnitIndex *Index;
53 std::unique_ptr<SectionContribution[]> Contributions;
54 friend class DWARFUnitIndex;
57 const SectionContribution *getOffset(DWARFSectionKind Sec) const;
58 const SectionContribution *getOffset() const;
64 DWARFSectionKind InfoColumnKind;
66 std::unique_ptr<DWARFSectionKind[]> ColumnKinds;
67 std::unique_ptr<Entry[]> Rows;
69 static StringRef getColumnHeader(DWARFSectionKind DS);
70 bool parseImpl(DataExtractor IndexData);
73 bool parse(DataExtractor IndexData);
74 DWARFUnitIndex(DWARFSectionKind InfoColumnKind)
75 : InfoColumnKind(InfoColumnKind) {}
76 void dump(raw_ostream &OS) const;
77 const Entry *getFromOffset(uint32_t Offset) const;