1 //===-- ManualDWARFIndex.h --------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_MANUALDWARFINDEX_H
10 #define LLDB_MANUALDWARFINDEX_H
12 #include "Plugins/SymbolFile/DWARF/DWARFIndex.h"
13 #include "Plugins/SymbolFile/DWARF/NameToDIE.h"
14 #include "llvm/ADT/DenseSet.h"
18 namespace lldb_private {
19 class ManualDWARFIndex : public DWARFIndex {
21 ManualDWARFIndex(Module &module, DWARFDebugInfo *debug_info,
22 llvm::DenseSet<dw_offset_t> units_to_avoid = {})
23 : DWARFIndex(module), m_debug_info(debug_info),
24 m_units_to_avoid(std::move(units_to_avoid)) {}
26 void Preload() override { Index(); }
28 void GetGlobalVariables(ConstString basename, DIEArray &offsets) override;
29 void GetGlobalVariables(const RegularExpression ®ex,
30 DIEArray &offsets) override;
31 void GetGlobalVariables(const DWARFUnit &unit, DIEArray &offsets) override;
32 void GetObjCMethods(ConstString class_name, DIEArray &offsets) override;
33 void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation,
34 DIEArray &offsets) override;
35 void GetTypes(ConstString name, DIEArray &offsets) override;
36 void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override;
37 void GetNamespaces(ConstString name, DIEArray &offsets) override;
38 void GetFunctions(ConstString name, SymbolFileDWARF &dwarf,
39 const CompilerDeclContext &parent_decl_ctx,
40 uint32_t name_type_mask,
41 std::vector<DWARFDIE> &dies) override;
42 void GetFunctions(const RegularExpression ®ex, DIEArray &offsets) override;
44 void ReportInvalidDIERef(const DIERef &ref, llvm::StringRef name) override {}
45 void Dump(Stream &s) override;
49 NameToDIE function_basenames;
50 NameToDIE function_fullnames;
51 NameToDIE function_methods;
52 NameToDIE function_selectors;
53 NameToDIE objc_class_selectors;
59 void IndexUnit(DWARFUnit &unit, IndexSet &set);
61 static void IndexUnitImpl(DWARFUnit &unit,
62 const lldb::LanguageType cu_language,
65 /// Non-null value means we haven't built the index yet.
66 DWARFDebugInfo *m_debug_info;
67 /// Which dwarf units should we skip while building the index.
68 llvm::DenseSet<dw_offset_t> m_units_to_avoid;
72 } // namespace lldb_private
74 #endif // LLDB_MANUALDWARFINDEX_H