]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / source / Plugins / SymbolFile / DWARF / DWARFDIECollection.cpp
1 //===-- DWARFDIECollection.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 "DWARFDIECollection.h"
11
12 #include <algorithm>
13
14 #include "lldb/Core/Stream.h"
15
16 using namespace lldb_private;
17 using namespace std;
18
19 void DWARFDIECollection::Append(const DWARFDIE &die) { m_dies.push_back(die); }
20
21 DWARFDIE
22 DWARFDIECollection::GetDIEAtIndex(uint32_t idx) const {
23   if (idx < m_dies.size())
24     return m_dies[idx];
25   return DWARFDIE();
26 }
27
28 size_t DWARFDIECollection::Size() const { return m_dies.size(); }
29
30 void DWARFDIECollection::Dump(Stream *s, const char *title) const {
31   if (title && title[0] != '\0')
32     s->Printf("%s\n", title);
33   for (const auto &die : m_dies)
34     s->Printf("0x%8.8x\n", die.GetOffset());
35 }