1 //===-- DWARFUnitIndex.cpp ------------------------------------------------===//
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 #include "llvm/DebugInfo/DWARF/DWARFUnitIndex.h"
14 bool DWARFUnitIndex::Header::parse(DataExtractor IndexData, uint32_t *OffsetPtr) {
15 Version = IndexData.getU32(OffsetPtr);
16 NumColumns = IndexData.getU32(OffsetPtr);
17 NumUnits = IndexData.getU32(OffsetPtr);
18 NumBuckets = IndexData.getU32(OffsetPtr);
22 void DWARFUnitIndex::Header::dump(raw_ostream &OS) const {
23 OS << "Index header:\n" << format(" version: %u\n", Version)
24 << format(" columns: %u\n", NumColumns)
25 << format(" units: %u\n", NumUnits)
26 << format(" buckets: %u\n", NumBuckets);
29 bool DWARFUnitIndex::parse(DataExtractor IndexData) {
31 if (!Header.parse(IndexData, &Offset))
37 void DWARFUnitIndex::dump(raw_ostream &OS) const {