182af9438SZachary Turner //===-- DWARFCompileUnit.cpp ----------------------------------------------===//
282af9438SZachary Turner //
382af9438SZachary Turner //                     The LLVM Compiler Infrastructure
482af9438SZachary Turner //
582af9438SZachary Turner // This file is distributed under the University of Illinois Open Source
682af9438SZachary Turner // License. See LICENSE.TXT for details.
782af9438SZachary Turner //
882af9438SZachary Turner //===----------------------------------------------------------------------===//
982af9438SZachary Turner 
1082af9438SZachary Turner #include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h"
1182af9438SZachary Turner #include "llvm/Support/Format.h"
1282af9438SZachary Turner #include "llvm/Support/raw_ostream.h"
1382af9438SZachary Turner 
1482af9438SZachary Turner using namespace llvm;
1582af9438SZachary Turner 
1682af9438SZachary Turner void DWARFCompileUnit::dump(raw_ostream &OS) {
1782af9438SZachary Turner   OS << format("0x%08x", getOffset()) << ": Compile Unit:"
1882af9438SZachary Turner      << " length = " << format("0x%08x", getLength())
1982af9438SZachary Turner      << " version = " << format("0x%04x", getVersion())
2082af9438SZachary Turner      << " abbr_offset = " << format("0x%04x", getAbbreviations()->getOffset())
2182af9438SZachary Turner      << " addr_size = " << format("0x%02x", getAddressByteSize())
2282af9438SZachary Turner      << " (next unit at " << format("0x%08x", getNextUnitOffset())
2382af9438SZachary Turner      << ")\n";
2482af9438SZachary Turner 
25*7a18c061SAlexey Samsonov   if (const DWARFDebugInfoEntryMinimal *CU = getUnitDIE(false))
2682af9438SZachary Turner     CU->dump(OS, this, -1U);
27*7a18c061SAlexey Samsonov   else
28*7a18c061SAlexey Samsonov     OS << "<compile unit can't be parsed!>\n\n";
2982af9438SZachary Turner }
3082af9438SZachary Turner 
3182af9438SZachary Turner // VTable anchor.
3282af9438SZachary Turner DWARFCompileUnit::~DWARFCompileUnit() {
3382af9438SZachary Turner }
34