LCOV - code coverage report
Current view: top level - lib/DebugInfo/PDB/Native - SymbolStream.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 9 13 69.2 %
Date: 2017-09-14 15:23:50 Functions: 4 6 66.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- SymbolStream.cpp - PDB Symbol Stream Access ------------------------===//
       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/PDB/Native/SymbolStream.h"
      11             : 
      12             : #include "llvm/DebugInfo/CodeView/CodeView.h"
      13             : #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
      14             : #include "llvm/DebugInfo/MSF/MappedBlockStream.h"
      15             : #include "llvm/DebugInfo/PDB/Native/PDBFile.h"
      16             : #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
      17             : #include "llvm/DebugInfo/PDB/Native/RawError.h"
      18             : #include "llvm/Support/BinaryStreamReader.h"
      19             : #include "llvm/Support/Endian.h"
      20             : 
      21             : using namespace llvm;
      22             : using namespace llvm::msf;
      23             : using namespace llvm::support;
      24             : using namespace llvm::pdb;
      25             : 
      26          12 : SymbolStream::SymbolStream(std::unique_ptr<MappedBlockStream> Stream)
      27          36 :     : Stream(std::move(Stream)) {}
      28             : 
      29          36 : SymbolStream::~SymbolStream() {}
      30             : 
      31          12 : Error SymbolStream::reload() {
      32          36 :   BinaryStreamReader Reader(*Stream);
      33             : 
      34          48 :   if (auto EC = Reader.readArray(SymbolRecords, Stream->getLength()))
      35           0 :     return EC;
      36             : 
      37          36 :   return Error::success();
      38             : }
      39             : 
      40             : iterator_range<codeview::CVSymbolArray::Iterator>
      41           0 : SymbolStream::getSymbols(bool *HadError) const {
      42           0 :   return llvm::make_range(SymbolRecords.begin(HadError), SymbolRecords.end());
      43             : }
      44             : 
      45           0 : Error SymbolStream::commit() { return Error::success(); }
      46             : 
      47         270 : codeview::CVSymbol SymbolStream::readRecord(uint32_t Offset) const {
      48        1080 :   return *SymbolRecords.at(Offset);
      49             : }

Generated by: LCOV version 1.13