LLVM  6.0.0svn
DebugLocStream.cpp
Go to the documentation of this file.
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"
13 
14 using namespace llvm;
15 
16 bool DebugLocStream::finalizeList(AsmPrinter &Asm) {
17  if (Lists.back().EntryOffset == Entries.size()) {
18  // Empty list. Delete it.
19  Lists.pop_back();
20  return false;
21  }
22 
23  // Real list. Generate a label for it.
24  Lists.back().Label = Asm.createTempSymbol("debug_loc");
25  return true;
26 }
27 
28 void DebugLocStream::finalizeEntry() {
29  if (Entries.back().ByteOffset != DWARFBytes.size())
30  return;
31 
32  // The last entry was empty. Delete it.
33  Comments.erase(Comments.begin() + Entries.back().CommentOffset,
34  Comments.end());
35  Entries.pop_back();
36 
37  assert(Lists.back().EntryOffset <= Entries.size() &&
38  "Popped off more entries than are in the list");
39 }
40 
42  if (!Locs.finalizeList(Asm))
43  return;
44  V.initializeDbgValue(&MI);
45  V.setDebugLocListIndex(ListIndex);
46 }
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
Definition: SmallVector.h:136
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
Definition: SmallVector.h:116
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:77
iterator erase(const_iterator CI)
Definition: SmallVector.h:449
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
Definition: SmallVector.h:120
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
IRTranslator LLVM IR MI
MCSymbol * createTempSymbol(const Twine &Name) const