1 //===-- NameToDIE.h ---------------------------------------------*- 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 #ifndef SymbolFileDWARF_NameToDIE_h_ 11 #define SymbolFileDWARF_NameToDIE_h_ 12 13 #include "lldb/Core/UniqueCStringMap.h" 14 15 #include <functional> 16 17 #include "lldb/lldb-defines.h" 18 19 class SymbolFileDWARF; 20 21 typedef std::vector<uint32_t> DIEArray; 22 23 class NameToDIE 24 { 25 public: NameToDIE()26 NameToDIE () : 27 m_map() 28 { 29 } 30 ~NameToDIE()31 ~NameToDIE () 32 { 33 } 34 35 void 36 Dump (lldb_private::Stream *s); 37 38 void 39 Insert (const lldb_private::ConstString& name, uint32_t die_offset); 40 41 void 42 Finalize(); 43 44 size_t 45 Find (const lldb_private::ConstString &name, 46 DIEArray &info_array) const; 47 48 size_t 49 Find (const lldb_private::RegularExpression& regex, 50 DIEArray &info_array) const; 51 52 size_t 53 FindAllEntriesForCompileUnit (uint32_t cu_offset, 54 uint32_t cu_end_offset, 55 DIEArray &info_array) const; 56 57 void 58 ForEach (std::function <bool(const char *name, uint32_t die_offset)> const &callback) const; 59 60 protected: 61 lldb_private::UniqueCStringMap<uint32_t> m_map; 62 63 }; 64 65 #endif // SymbolFileDWARF_NameToDIE_h_ 66