]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
Merge clang 7.0.1 and several follow-up changes
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / source / Plugins / SymbolFile / DWARF / DWARFIndex.h
1 //===-- DWARFIndex.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 LLDB_DWARFINDEX_H
11 #define LLDB_DWARFINDEX_H
12
13 #include "Plugins/SymbolFile/DWARF/DIERef.h"
14 #include "Plugins/SymbolFile/DWARF/DWARFDIE.h"
15 #include "Plugins/SymbolFile/DWARF/DWARFFormValue.h"
16
17 class DWARFDebugInfo;
18 class DWARFDeclContext;
19 class DWARFDIE;
20
21 namespace lldb_private {
22 class DWARFIndex {
23 public:
24   DWARFIndex(Module &module) : m_module(module) {}
25   virtual ~DWARFIndex();
26
27   virtual void Preload() = 0;
28
29   /// Finds global variables with the given base name. Any additional filtering
30   /// (e.g., to only retrieve variables from a given context) should be done by
31   /// the consumer.
32   virtual void GetGlobalVariables(ConstString basename, DIEArray &offsets) = 0;
33
34   virtual void GetGlobalVariables(const RegularExpression &regex,
35                                   DIEArray &offsets) = 0;
36   virtual void GetGlobalVariables(const DWARFUnit &cu, DIEArray &offsets) = 0;
37   virtual void GetObjCMethods(ConstString class_name, DIEArray &offsets) = 0;
38   virtual void GetCompleteObjCClass(ConstString class_name,
39                                     bool must_be_implementation,
40                                     DIEArray &offsets) = 0;
41   virtual void GetTypes(ConstString name, DIEArray &offsets) = 0;
42   virtual void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) = 0;
43   virtual void GetNamespaces(ConstString name, DIEArray &offsets) = 0;
44   virtual void GetFunctions(ConstString name, DWARFDebugInfo &info,
45                             const CompilerDeclContext &parent_decl_ctx,
46                             uint32_t name_type_mask,
47                             std::vector<DWARFDIE> &dies) = 0;
48   virtual void GetFunctions(const RegularExpression &regex,
49                             DIEArray &offsets) = 0;
50
51   virtual void ReportInvalidDIEOffset(dw_offset_t offset,
52                                       llvm::StringRef name) = 0;
53   virtual void Dump(Stream &s) = 0;
54
55 protected:
56   Module &m_module;
57
58   /// Helper function implementing common logic for processing function dies. If
59   /// the function given by "ref" matches search criteria given by
60   /// "parent_decl_ctx" and "name_type_mask", it is inserted into the "dies"
61   /// vector.
62   void ProcessFunctionDIE(llvm::StringRef name, DIERef ref,
63                           DWARFDebugInfo &info,
64                           const CompilerDeclContext &parent_decl_ctx,
65                           uint32_t name_type_mask, std::vector<DWARFDIE> &dies);
66 };
67 } // namespace lldb_private
68
69 #endif // LLDB_DWARFINDEX_H