Files
clang-p2996/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.h
Greg Clayton 6071e6fc94 Major DWARF cleanup.
Added a new class called DWARFDIE that contains a DWARFCompileUnit and DWARFDebugInfoEntry so that these items always stay together.

There were many places where we just handed out DWARFDebugInfoEntry pointers and then use them with a compile unit that may or may not be the correct one. Clients outside of DWARFCompileUnit and DWARFDebugInfoEntry should all be dealing with DWARFDIE instances instead of playing with DWARFCompileUnit/DWARFDebugInfoEntry pairs manually.

This paves to the way for some modifications that are coming for DWO.

llvm-svn: 246100
2015-08-26 22:57:51 +00:00

52 lines
1.1 KiB
C++

//===-- DWARFDIECollection.h ------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef SymbolFileDWARF_DWARFDIECollection_h_
#define SymbolFileDWARF_DWARFDIECollection_h_
#include "DWARFDIE.h"
#include <vector>
class DWARFDIECollection
{
public:
DWARFDIECollection() :
m_dies()
{
}
~DWARFDIECollection()
{
}
void
Append (const DWARFDIE &die);
void
Dump(lldb_private::Stream *s, const char* title) const;
DWARFDIE
GetDIEAtIndex (uint32_t idx) const;
bool
Insert(const DWARFDIE &die);
size_t
Size() const;
protected:
typedef std::vector<DWARFDIE> collection;
typedef collection::iterator iterator;
typedef collection::const_iterator const_iterator;
collection m_dies; // Ordered list of die offsets
};
#endif // SymbolFileDWARF_DWARFDIECollection_h_