LCOV - code coverage report
Current view: top level - lib/DebugInfo/DWARF - DWARFTypeUnit.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 21 22 95.5 %
Date: 2018-07-13 00:08:38 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- DWARFTypeUnit.cpp --------------------------------------------------===//
       2             : //
       3             : //                     The LLVM Compiler Infrastructure
       4             : //
       5             : // This file is distributed under the University of Illinois Open Source
       6             : // License. See LICENSE.TXT for details.
       7             : //
       8             : //===----------------------------------------------------------------------===//
       9             : 
      10             : #include "llvm/DebugInfo/DWARF/DWARFTypeUnit.h"
      11             : #include "llvm/DebugInfo/DIContext.h"
      12             : #include "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h"
      13             : #include "llvm/DebugInfo/DWARF/DWARFDie.h"
      14             : #include "llvm/DebugInfo/DWARF/DWARFUnit.h"
      15             : #include "llvm/Support/Format.h"
      16             : #include "llvm/Support/raw_ostream.h"
      17             : #include <cinttypes>
      18             : 
      19             : using namespace llvm;
      20             : 
      21          55 : void DWARFTypeUnit::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {
      22         110 :   DWARFDie TD = getDIEForOffset(getTypeOffset() + getOffset());
      23          55 :   const char *Name = TD.getName(DINameKind::ShortName);
      24             : 
      25          55 :   if (DumpOpts.SummarizeTypes) {
      26           2 :     OS << "name = '" << Name << "'"
      27           6 :        << " type_signature = " << format("0x%016" PRIx64, getTypeHash())
      28           6 :        << " length = " << format("0x%08x", getLength()) << '\n';
      29           2 :     return;
      30             :   }
      31             : 
      32         106 :   OS << format("0x%08x", getOffset()) << ": Type Unit:"
      33         159 :      << " length = " << format("0x%08x", getLength())
      34         106 :      << " version = " << format("0x%04x", getVersion());
      35          53 :   if (getVersion() >= 5)
      36          28 :     OS << " unit_type = " << dwarf::UnitTypeString(getUnitType());
      37         159 :   OS << " abbr_offset = " << format("0x%04x", getAbbreviations()->getOffset())
      38         159 :      << " addr_size = " << format("0x%02x", getAddressByteSize())
      39          53 :      << " name = '" << Name << "'"
      40         159 :      << " type_signature = " << format("0x%016" PRIx64, getTypeHash())
      41         159 :      << " type_offset = " << format("0x%04x", getTypeOffset())
      42         106 :      << " (next unit at " << format("0x%08x", getNextUnitOffset()) << ")\n";
      43             : 
      44          53 :   if (DWARFDie TU = getUnitDIE(false))
      45          53 :     TU.dump(OS, 0, DumpOpts);
      46             :   else
      47           0 :     OS << "<type unit can't be parsed!>\n\n";
      48             : }

Generated by: LCOV version 1.13