1336823Sdim//===-- AppleDWARFIndex.h --------------------------------------*- C++ -*-===//
2336823Sdim//
3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4353358Sdim// See https://llvm.org/LICENSE.txt for license information.
5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6336823Sdim//
7336823Sdim//===----------------------------------------------------------------------===//
8336823Sdim
9336823Sdim#ifndef LLDB_APPLEDWARFINDEX_H
10336823Sdim#define LLDB_APPLEDWARFINDEX_H
11336823Sdim
12336823Sdim#include "Plugins/SymbolFile/DWARF/DWARFIndex.h"
13336823Sdim#include "Plugins/SymbolFile/DWARF/HashedNameToDIE.h"
14336823Sdim
15336823Sdimnamespace lldb_private {
16336823Sdimclass AppleDWARFIndex : public DWARFIndex {
17336823Sdimpublic:
18336823Sdim  static std::unique_ptr<AppleDWARFIndex>
19336823Sdim  Create(Module &module, DWARFDataExtractor apple_names,
20336823Sdim         DWARFDataExtractor apple_namespaces, DWARFDataExtractor apple_types,
21336823Sdim         DWARFDataExtractor apple_objc, DWARFDataExtractor debug_str);
22336823Sdim
23336823Sdim  AppleDWARFIndex(
24336823Sdim      Module &module, std::unique_ptr<DWARFMappedHash::MemoryTable> apple_names,
25336823Sdim      std::unique_ptr<DWARFMappedHash::MemoryTable> apple_namespaces,
26336823Sdim      std::unique_ptr<DWARFMappedHash::MemoryTable> apple_types,
27336823Sdim      std::unique_ptr<DWARFMappedHash::MemoryTable> apple_objc)
28336823Sdim      : DWARFIndex(module), m_apple_names_up(std::move(apple_names)),
29336823Sdim        m_apple_namespaces_up(std::move(apple_namespaces)),
30336823Sdim        m_apple_types_up(std::move(apple_types)),
31336823Sdim        m_apple_objc_up(std::move(apple_objc)) {}
32336823Sdim
33336823Sdim  void Preload() override {}
34336823Sdim
35336823Sdim  void GetGlobalVariables(ConstString basename, DIEArray &offsets) override;
36336823Sdim  void GetGlobalVariables(const RegularExpression &regex,
37336823Sdim                          DIEArray &offsets) override;
38336823Sdim  void GetGlobalVariables(const DWARFUnit &cu, DIEArray &offsets) override;
39336823Sdim  void GetObjCMethods(ConstString class_name, DIEArray &offsets) override;
40336823Sdim  void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation,
41336823Sdim                            DIEArray &offsets) override;
42336823Sdim  void GetTypes(ConstString name, DIEArray &offsets) override;
43336823Sdim  void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override;
44336823Sdim  void GetNamespaces(ConstString name, DIEArray &offsets) override;
45353358Sdim  void GetFunctions(ConstString name, SymbolFileDWARF &dwarf,
46336823Sdim                    const CompilerDeclContext &parent_decl_ctx,
47336823Sdim                    uint32_t name_type_mask,
48336823Sdim                    std::vector<DWARFDIE> &dies) override;
49336823Sdim  void GetFunctions(const RegularExpression &regex, DIEArray &offsets) override;
50336823Sdim
51353358Sdim  void ReportInvalidDIERef(const DIERef &ref, llvm::StringRef name) override;
52336823Sdim  void Dump(Stream &s) override;
53336823Sdim
54336823Sdimprivate:
55336823Sdim  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_names_up;
56336823Sdim  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_namespaces_up;
57336823Sdim  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_types_up;
58336823Sdim  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_objc_up;
59336823Sdim};
60336823Sdim} // namespace lldb_private
61336823Sdim
62336823Sdim#endif // LLDB_APPLEDWARFINDEX_H
63