Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/CodeGen/AsmPrinter/DebugLocStream.cpp
Line
Count
Source
1
//===- DebugLocStream.cpp - DWARF debug_loc stream --------------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "DebugLocStream.h"
10
#include "DwarfDebug.h"
11
#include "llvm/CodeGen/AsmPrinter.h"
12
13
using namespace llvm;
14
15
503
bool DebugLocStream::finalizeList(AsmPrinter &Asm) {
16
503
  if (Lists.back().EntryOffset == Entries.size()) {
17
84
    // Empty list.  Delete it.
18
84
    Lists.pop_back();
19
84
    return false;
20
84
  }
21
419
22
419
  // Real list.  Generate a label for it.
23
419
  Lists.back().Label = Asm.createTempSymbol("debug_loc");
24
419
  return true;
25
419
}
26
27
667
void DebugLocStream::finalizeEntry() {
28
667
  if (Entries.back().ByteOffset != DWARFBytes.size())
29
643
    return;
30
24
31
24
  // The last entry was empty.  Delete it.
32
24
  Comments.erase(Comments.begin() + Entries.back().CommentOffset,
33
24
                 Comments.end());
34
24
  Entries.pop_back();
35
24
36
24
  assert(Lists.back().EntryOffset <= Entries.size() &&
37
24
         "Popped off more entries than are in the list");
38
24
}
39
40
503
DebugLocStream::ListBuilder::~ListBuilder() {
41
503
  if (!Locs.finalizeList(Asm))
42
84
    return;
43
419
  V.initializeDbgValue(&MI);
44
419
  V.setDebugLocListIndex(ListIndex);
45
419
}