LCOV - code coverage report
Current view: top level - lib/CodeGen/AsmPrinter - DebugLocStream.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 16 16 100.0 %
Date: 2017-09-14 15:23:50 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- DebugLocStream.cpp - DWARF debug_loc stream --------------*- 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 "DebugLocStream.h"
      11             : #include "DwarfDebug.h"
      12             : #include "llvm/CodeGen/AsmPrinter.h"
      13             : 
      14             : using namespace llvm;
      15             : 
      16        8790 : bool DebugLocStream::finalizeList(AsmPrinter &Asm) {
      17       26370 :   if (Lists.back().EntryOffset == Entries.size()) {
      18             :     // Empty list.  Delete it.
      19          60 :     Lists.pop_back();
      20          30 :     return false;
      21             :   }
      22             : 
      23             :   // Real list.  Generate a label for it.
      24       17520 :   Lists.back().Label = Asm.createTempSymbol("debug_loc");
      25        8760 :   return true;
      26             : }
      27             : 
      28       12721 : void DebugLocStream::finalizeEntry() {
      29       38163 :   if (Entries.back().ByteOffset != DWARFBytes.size())
      30             :     return;
      31             : 
      32             :   // The last entry was empty.  Delete it.
      33          24 :   Comments.erase(Comments.begin() + Entries.back().CommentOffset,
      34          12 :                  Comments.end());
      35           6 :   Entries.pop_back();
      36             : 
      37             :   assert(Lists.back().EntryOffset <= Entries.size() &&
      38             :          "Popped off more entries than are in the list");
      39             : }
      40             : 
      41       17550 : DebugLocStream::ListBuilder::~ListBuilder() {
      42        8790 :   if (!Locs.finalizeList(Asm))
      43             :     return;
      44        8760 :   V.initializeDbgValue(&MI);
      45       17520 :   V.setDebugLocListIndex(ListIndex);
      46        8790 : }

Generated by: LCOV version 1.13