llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp
Zachary Turner bf9a77305f Move classes from Core -> Utility.
This moves the following classes from Core -> Utility.

ConstString
Error
RegularExpression
Stream
StreamString

The goal here is to get lldbUtility into a state where it has
no dependendencies except on itself and LLVM, so it can be the
starting point at which to start untangling LLDB's dependencies.
These are all low level and very widely used classes, and
previously lldbUtility had dependencies up to lldbCore in order
to use these classes.  So moving then down to lldbUtility makes
sense from both the short term and long term perspective in
solving this problem.

Differential Revision: https://reviews.llvm.org/D29427

llvm-svn: 293941
2017-02-02 21:39:50 +00:00

36 lines
982 B
C++

//===-- DWARFDIECollection.cpp ----------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "DWARFDIECollection.h"
#include <algorithm>
#include "lldb/Utility/Stream.h"
using namespace lldb_private;
using namespace std;
void DWARFDIECollection::Append(const DWARFDIE &die) { m_dies.push_back(die); }
DWARFDIE
DWARFDIECollection::GetDIEAtIndex(uint32_t idx) const {
if (idx < m_dies.size())
return m_dies[idx];
return DWARFDIE();
}
size_t DWARFDIECollection::Size() const { return m_dies.size(); }
void DWARFDIECollection::Dump(Stream *s, const char *title) const {
if (title && title[0] != '\0')
s->Printf("%s\n", title);
for (const auto &die : m_dies)
s->Printf("0x%8.8x\n", die.GetOffset());
}