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

          Line data    Source code
       1             : //===- DebugFrameDataSubsection.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/DebugFrameDataSubsection.h"
      11             : #include "llvm/DebugInfo/CodeView/CodeViewError.h"
      12             : 
      13             : using namespace llvm;
      14             : using namespace llvm::codeview;
      15             : 
      16          75 : Error DebugFrameDataSubsectionRef::initialize(BinaryStreamReader Reader) {
      17         150 :   if (auto EC = Reader.readObject(RelocPtr))
      18             :     return EC;
      19          75 :   if (Reader.bytesRemaining() % sizeof(FrameData) != 0)
      20             :     return make_error<CodeViewError>(cv_error_code::corrupt_record,
      21             :                                      "Invalid frame data record format!");
      22             : 
      23          75 :   uint32_t Count = Reader.bytesRemaining() / sizeof(FrameData);
      24         150 :   if (auto EC = Reader.readArray(Frames, Count))
      25             :     return EC;
      26             :   return Error::success();
      27             : }
      28             : 
      29           3 : uint32_t DebugFrameDataSubsection::calculateSerializedSize() const {
      30           6 :   return 4 + sizeof(FrameData) * Frames.size();
      31             : }
      32             : 
      33           1 : Error DebugFrameDataSubsection::commit(BinaryStreamWriter &Writer) const {
      34           2 :   if (auto EC = Writer.writeInteger<uint32_t>(0))
      35             :     return EC;
      36             : 
      37           2 :   if (auto EC = Writer.writeArray(makeArrayRef(Frames)))
      38             :     return EC;
      39             :   return Error::success();
      40             : }
      41             : 
      42           1 : void DebugFrameDataSubsection::addFrameData(const FrameData &Frame) {
      43           1 :   Frames.push_back(Frame);
      44           1 : }

Generated by: LCOV version 1.13