Files
clang-p2996/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h
Tamas Berghammer 2ff8870b6f Re-commit "Make dwarf parsing multi-threaded"
Re-commit the change after fixing a lot of race condition in LLDB
exposed by this change

Loading the debug info from a large application is the slowest task
LLDB do. This CL makes most of the dwarf parsing code multi-threaded.

As a result the speed of "attach; backtrace; exit;" when the inferior
is an LLDB with full debug info increased by a factor of 2.

Differential revision: http://reviews.llvm.org/D13662

llvm-svn: 251106
2015-10-23 10:34:49 +00:00

63 lines
1.4 KiB
C++

//===-- NameToDIE.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_NameToDIE_h_
#define SymbolFileDWARF_NameToDIE_h_
#include <functional>
#include "lldb/Core/dwarf.h"
#include "lldb/Core/UniqueCStringMap.h"
#include "lldb/lldb-defines.h"
#include "DIERef.h"
class SymbolFileDWARF;
class NameToDIE
{
public:
NameToDIE () :
m_map()
{
}
~NameToDIE ()
{
}
void
Dump (lldb_private::Stream *s);
void
Insert (const lldb_private::ConstString& name, const DIERef& die_ref);
void
Append (const NameToDIE& other);
void
Finalize();
size_t
Find (const lldb_private::ConstString &name, DIEArray &info_array) const;
size_t
Find (const lldb_private::RegularExpression& regex, DIEArray &info_array) const;
size_t
FindAllEntriesForCompileUnit (dw_offset_t cu_offset, DIEArray &info_array) const;
void
ForEach (std::function <bool(const char *name, const DIERef& die_ref)> const &callback) const;
protected:
lldb_private::UniqueCStringMap<DIERef> m_map;
};
#endif // SymbolFileDWARF_NameToDIE_h_