1 //===-- ManulaDWARFIndex.h -------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_MANUALDWARFINDEX_H
11 #define LLDB_MANUALDWARFINDEX_H
13 #include "Plugins/SymbolFile/DWARF/DWARFIndex.h"
14 #include "Plugins/SymbolFile/DWARF/NameToDIE.h"
15 #include "llvm/ADT/DenseSet.h"
17 namespace lldb_private {
18 class ManualDWARFIndex : public DWARFIndex {
20 ManualDWARFIndex(Module &module, DWARFDebugInfo *debug_info,
21 llvm::DenseSet<dw_offset_t> units_to_avoid = {})
22 : DWARFIndex(module), m_debug_info(debug_info),
23 m_units_to_avoid(std::move(units_to_avoid)) {}
25 void Preload() override { Index(); }
27 void GetGlobalVariables(ConstString basename, DIEArray &offsets) override;
28 void GetGlobalVariables(const RegularExpression ®ex,
29 DIEArray &offsets) override;
30 void GetGlobalVariables(const DWARFUnit &cu, DIEArray &offsets) override;
31 void GetObjCMethods(ConstString class_name, DIEArray &offsets) override;
32 void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation,
33 DIEArray &offsets) override;
34 void GetTypes(ConstString name, DIEArray &offsets) override;
35 void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override;
36 void GetNamespaces(ConstString name, DIEArray &offsets) override;
37 void GetFunctions(ConstString name, DWARFDebugInfo &info,
38 const CompilerDeclContext &parent_decl_ctx,
39 uint32_t name_type_mask,
40 std::vector<DWARFDIE> &dies) override;
41 void GetFunctions(const RegularExpression ®ex, DIEArray &offsets) override;
43 void ReportInvalidDIEOffset(dw_offset_t offset,
44 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);
62 IndexUnitImpl(DWARFUnit &unit, const lldb::LanguageType cu_language,
63 const DWARFFormValue::FixedFormSizes &fixed_form_sizes,
64 const dw_offset_t cu_offset, IndexSet &set);
66 /// Non-null value means we haven't built the index yet.
67 DWARFDebugInfo *m_debug_info;
68 /// Which dwarf units should we skip while building the index.
69 llvm::DenseSet<dw_offset_t> m_units_to_avoid;
73 } // namespace lldb_private
75 #endif // LLDB_MANUALDWARFINDEX_H