LLDB  mainline
NameToDIE.h
Go to the documentation of this file.
1 //===-- NameToDIE.h ---------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef SymbolFileDWARF_NameToDIE_h_
10 #define SymbolFileDWARF_NameToDIE_h_
11 
12 #include <functional>
13 
14 #include "DIERef.h"
16 #include "lldb/Core/dwarf.h"
17 #include "lldb/lldb-defines.h"
18 
19 class SymbolFileDWARF;
20 
21 class NameToDIE {
22 public:
23  NameToDIE() : m_map() {}
24 
26 
27  void Dump(lldb_private::Stream *s);
28 
29  void Insert(lldb_private::ConstString name, const DIERef &die_ref);
30 
31  void Append(const NameToDIE &other);
32 
33  void Finalize();
34 
35  size_t Find(lldb_private::ConstString name,
36  DIEArray &info_array) const;
37 
38  size_t Find(const lldb_private::RegularExpression &regex,
39  DIEArray &info_array) const;
40 
42  DIEArray &info_array) const;
43 
44  void
45  ForEach(std::function<bool(lldb_private::ConstString name,
46  const DIERef &die_ref)> const
47  &callback) const;
48 
49 protected:
51 };
52 
53 #endif // SymbolFileDWARF_NameToDIE_h_
void Append(const NameToDIE &other)
Definition: NameToDIE.cpp:74
void Finalize()
Definition: NameToDIE.cpp:23
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
size_t FindAllEntriesForCompileUnit(dw_offset_t cu_offset, DIEArray &info_array) const
Definition: NameToDIE.cpp:41
"lldb/Utility/RegularExpression.h" A C++ wrapper class for regex.
Definition: DIERef.h:18
std::vector< DIERef > DIEArray
Definition: DIERef.h:51
lldb_private::UniqueCStringMap< DIERef > m_map
Definition: NameToDIE.h:50
NameToDIE()
Definition: NameToDIE.h:23
void Insert(lldb_private::ConstString name, const DIERef &die_ref)
Definition: NameToDIE.cpp:28
void Dump(lldb_private::Stream *s)
Definition: NameToDIE.cpp:53
void ForEach(std::function< bool(lldb_private::ConstString name, const DIERef &die_ref)> const &callback) const
Definition: NameToDIE.cpp:63
~NameToDIE()
Definition: NameToDIE.h:25
A uniqued constant string class.
Definition: ConstString.h:38
size_t Find(lldb_private::ConstString name, DIEArray &info_array) const
Definition: NameToDIE.cpp:32