LCOV - code coverage report
Current view: top level - lib/DebugInfo/CodeView - DebugSubsectionVisitor.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 35 51 68.6 %
Date: 2017-09-14 15:23:50 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- DebugSubsectionVisitor.cpp -------------------------------*- C++ -*-===//
       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/CodeView/DebugSubsectionVisitor.h"
      11             : 
      12             : #include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h"
      13             : #include "llvm/DebugInfo/CodeView/DebugCrossExSubsection.h"
      14             : #include "llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h"
      15             : #include "llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h"
      16             : #include "llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h"
      17             : #include "llvm/DebugInfo/CodeView/DebugLinesSubsection.h"
      18             : #include "llvm/DebugInfo/CodeView/DebugStringTableSubsection.h"
      19             : #include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h"
      20             : #include "llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h"
      21             : #include "llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h"
      22             : #include "llvm/DebugInfo/CodeView/DebugUnknownSubsection.h"
      23             : #include "llvm/Support/BinaryStreamReader.h"
      24             : #include "llvm/Support/BinaryStreamRef.h"
      25             : 
      26             : using namespace llvm;
      27             : using namespace llvm::codeview;
      28             : 
      29          18 : Error llvm::codeview::visitDebugSubsection(
      30             :     const DebugSubsectionRecord &R, DebugSubsectionVisitor &V,
      31             :     const StringsAndChecksumsRef &State) {
      32          54 :   BinaryStreamReader Reader(R.getRecordData());
      33          18 :   switch (R.kind()) {
      34           4 :   case DebugSubsectionKind::Lines: {
      35           8 :     DebugLinesSubsectionRef Fragment;
      36          16 :     if (auto EC = Fragment.initialize(Reader))
      37           0 :       return EC;
      38             : 
      39           4 :     return V.visitLines(Fragment, State);
      40             :   }
      41           3 :   case DebugSubsectionKind::FileChecksums: {
      42           6 :     DebugChecksumsSubsectionRef Fragment;
      43          12 :     if (auto EC = Fragment.initialize(Reader))
      44           0 :       return EC;
      45             : 
      46           3 :     return V.visitFileChecksums(Fragment, State);
      47             :   }
      48           1 :   case DebugSubsectionKind::InlineeLines: {
      49           2 :     DebugInlineeLinesSubsectionRef Fragment;
      50           3 :     if (auto EC = Fragment.initialize(Reader))
      51           0 :       return EC;
      52           1 :     return V.visitInlineeLines(Fragment, State);
      53             :   }
      54           2 :   case DebugSubsectionKind::CrossScopeExports: {
      55           4 :     DebugCrossModuleExportsSubsectionRef Section;
      56           8 :     if (auto EC = Section.initialize(Reader))
      57           0 :       return EC;
      58           2 :     return V.visitCrossModuleExports(Section, State);
      59             :   }
      60           1 :   case DebugSubsectionKind::CrossScopeImports: {
      61           2 :     DebugCrossModuleImportsSubsectionRef Section;
      62           4 :     if (auto EC = Section.initialize(Reader))
      63           0 :       return EC;
      64           1 :     return V.visitCrossModuleImports(Section, State);
      65             :   }
      66           4 :   case DebugSubsectionKind::Symbols: {
      67           8 :     DebugSymbolsSubsectionRef Section;
      68          16 :     if (auto EC = Section.initialize(Reader))
      69           0 :       return EC;
      70           4 :     return V.visitSymbols(Section, State);
      71             :   }
      72           2 :   case DebugSubsectionKind::StringTable: {
      73           4 :     DebugStringTableSubsectionRef Section;
      74           6 :     if (auto EC = Section.initialize(Reader))
      75           0 :       return EC;
      76           2 :     return V.visitStringTable(Section, State);
      77             :   }
      78           1 :   case DebugSubsectionKind::FrameData: {
      79           2 :     DebugFrameDataSubsectionRef Section;
      80           4 :     if (auto EC = Section.initialize(Reader))
      81           0 :       return EC;
      82           1 :     return V.visitFrameData(Section, State);
      83             :   }
      84           0 :   case DebugSubsectionKind::CoffSymbolRVA: {
      85           0 :     DebugSymbolRVASubsectionRef Section;
      86           0 :     if (auto EC = Section.initialize(Reader))
      87           0 :       return EC;
      88           0 :     return V.visitCOFFSymbolRVAs(Section, State);
      89             :   }
      90           0 :   default: {
      91           0 :     DebugUnknownSubsectionRef Fragment(R.kind(), R.getRecordData());
      92           0 :     return V.visitUnknown(Fragment);
      93             :   }
      94             :   }
      95             : }

Generated by: LCOV version 1.13