1*82af9438SZachary Turner //===-- DWARFCompileUnit.cpp ----------------------------------------------===//
2*82af9438SZachary Turner //
3*82af9438SZachary Turner //                     The LLVM Compiler Infrastructure
4*82af9438SZachary Turner //
5*82af9438SZachary Turner // This file is distributed under the University of Illinois Open Source
6*82af9438SZachary Turner // License. See LICENSE.TXT for details.
7*82af9438SZachary Turner //
8*82af9438SZachary Turner //===----------------------------------------------------------------------===//
9*82af9438SZachary Turner 
10*82af9438SZachary Turner #include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h"
11*82af9438SZachary Turner #include "llvm/Support/Format.h"
12*82af9438SZachary Turner #include "llvm/Support/raw_ostream.h"
13*82af9438SZachary Turner 
14*82af9438SZachary Turner using namespace llvm;
15*82af9438SZachary Turner 
16*82af9438SZachary Turner void DWARFCompileUnit::dump(raw_ostream &OS) {
17*82af9438SZachary Turner   OS << format("0x%08x", getOffset()) << ": Compile Unit:"
18*82af9438SZachary Turner      << " length = " << format("0x%08x", getLength())
19*82af9438SZachary Turner      << " version = " << format("0x%04x", getVersion())
20*82af9438SZachary Turner      << " abbr_offset = " << format("0x%04x", getAbbreviations()->getOffset())
21*82af9438SZachary Turner      << " addr_size = " << format("0x%02x", getAddressByteSize())
22*82af9438SZachary Turner      << " (next unit at " << format("0x%08x", getNextUnitOffset())
23*82af9438SZachary Turner      << ")\n";
24*82af9438SZachary Turner 
25*82af9438SZachary Turner   const DWARFDebugInfoEntryMinimal *CU = getCompileUnitDIE(false);
26*82af9438SZachary Turner   assert(CU && "Null Compile Unit?");
27*82af9438SZachary Turner   CU->dump(OS, this, -1U);
28*82af9438SZachary Turner }
29*82af9438SZachary Turner 
30*82af9438SZachary Turner // VTable anchor.
31*82af9438SZachary Turner DWARFCompileUnit::~DWARFCompileUnit() {
32*82af9438SZachary Turner }
33