AppleDWARFIndex.h revision 336823
1336823Sdim//===-- AppleDWARFIndex.h --------------------------------------*- C++ -*-===//
2336823Sdim//
3336823Sdim//                     The LLVM Compiler Infrastructure
4336823Sdim//
5336823Sdim// This file is distributed under the University of Illinois Open Source
6336823Sdim// License. See LICENSE.TXT for details.
7336823Sdim//
8336823Sdim//===----------------------------------------------------------------------===//
9336823Sdim
10336823Sdim#ifndef LLDB_APPLEDWARFINDEX_H
11336823Sdim#define LLDB_APPLEDWARFINDEX_H
12336823Sdim
13336823Sdim#include "Plugins/SymbolFile/DWARF/DWARFIndex.h"
14336823Sdim#include "Plugins/SymbolFile/DWARF/HashedNameToDIE.h"
15336823Sdim
16336823Sdimnamespace lldb_private {
17336823Sdimclass AppleDWARFIndex : public DWARFIndex {
18336823Sdimpublic:
19336823Sdim  static std::unique_ptr<AppleDWARFIndex>
20336823Sdim  Create(Module &module, DWARFDataExtractor apple_names,
21336823Sdim         DWARFDataExtractor apple_namespaces, DWARFDataExtractor apple_types,
22336823Sdim         DWARFDataExtractor apple_objc, DWARFDataExtractor debug_str);
23336823Sdim
24336823Sdim  AppleDWARFIndex(
25336823Sdim      Module &module, std::unique_ptr<DWARFMappedHash::MemoryTable> apple_names,
26336823Sdim      std::unique_ptr<DWARFMappedHash::MemoryTable> apple_namespaces,
27336823Sdim      std::unique_ptr<DWARFMappedHash::MemoryTable> apple_types,
28336823Sdim      std::unique_ptr<DWARFMappedHash::MemoryTable> apple_objc)
29336823Sdim      : DWARFIndex(module), m_apple_names_up(std::move(apple_names)),
30336823Sdim        m_apple_namespaces_up(std::move(apple_namespaces)),
31336823Sdim        m_apple_types_up(std::move(apple_types)),
32336823Sdim        m_apple_objc_up(std::move(apple_objc)) {}
33336823Sdim
34336823Sdim  void Preload() override {}
35336823Sdim
36336823Sdim  void GetGlobalVariables(ConstString basename, DIEArray &offsets) override;
37336823Sdim  void GetGlobalVariables(const RegularExpression &regex,
38336823Sdim                          DIEArray &offsets) override;
39336823Sdim  void GetGlobalVariables(const DWARFUnit &cu, DIEArray &offsets) override;
40336823Sdim  void GetObjCMethods(ConstString class_name, DIEArray &offsets) override;
41336823Sdim  void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation,
42336823Sdim                            DIEArray &offsets) override;
43336823Sdim  void GetTypes(ConstString name, DIEArray &offsets) override;
44336823Sdim  void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override;
45336823Sdim  void GetNamespaces(ConstString name, DIEArray &offsets) override;
46336823Sdim  void GetFunctions(ConstString name, DWARFDebugInfo &info,
47336823Sdim                    const CompilerDeclContext &parent_decl_ctx,
48336823Sdim                    uint32_t name_type_mask,
49336823Sdim                    std::vector<DWARFDIE> &dies) override;
50336823Sdim  void GetFunctions(const RegularExpression &regex, DIEArray &offsets) override;
51336823Sdim
52336823Sdim  void ReportInvalidDIEOffset(dw_offset_t offset,
53336823Sdim                              llvm::StringRef name) override;
54336823Sdim  void Dump(Stream &s) override;
55336823Sdim
56336823Sdimprivate:
57336823Sdim  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_names_up;
58336823Sdim  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_namespaces_up;
59336823Sdim  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_types_up;
60336823Sdim  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_objc_up;
61336823Sdim};
62336823Sdim} // namespace lldb_private
63336823Sdim
64336823Sdim#endif // LLDB_APPLEDWARFINDEX_H
65