LCOV - code coverage report
Current view: top level - lib/DebugInfo/PDB/Native - SymbolStream.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 8 11 72.7 %
Date: 2018-07-13 00:08:38 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/Support/BinaryStreamReader.h"
      16             : #include "llvm/Support/Endian.h"
      17             : 
      18             : using namespace llvm;
      19             : using namespace llvm::msf;
      20             : using namespace llvm::support;
      21             : using namespace llvm::pdb;
      22             : 
      23          13 : SymbolStream::SymbolStream(std::unique_ptr<MappedBlockStream> Stream)
      24          13 :     : Stream(std::move(Stream)) {}
      25             : 
      26          26 : SymbolStream::~SymbolStream() {}
      27             : 
      28          13 : Error SymbolStream::reload() {
      29          13 :   BinaryStreamReader Reader(*Stream);
      30             : 
      31          26 :   if (auto EC = Reader.readArray(SymbolRecords, Stream->getLength()))
      32             :     return EC;
      33             : 
      34             :   return Error::success();
      35             : }
      36             : 
      37             : iterator_range<codeview::CVSymbolArray::Iterator>
      38           0 : SymbolStream::getSymbols(bool *HadError) const {
      39           0 :   return llvm::make_range(SymbolRecords.begin(HadError), SymbolRecords.end());
      40             : }
      41             : 
      42           0 : Error SymbolStream::commit() { return Error::success(); }
      43             : 
      44         270 : codeview::CVSymbol SymbolStream::readRecord(uint32_t Offset) const {
      45         540 :   return *SymbolRecords.at(Offset);
      46             : }

Generated by: LCOV version 1.13