1//===-- SymbolFileDWARFDwo.h ------------------------------------*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDWO_H
10#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDWO_H
11
12#include "SymbolFileDWARF.h"
13
14class SymbolFileDWARFDwo : public SymbolFileDWARF {
15  /// LLVM RTTI support.
16  static char ID;
17
18public:
19  /// LLVM RTTI support.
20  /// \{
21  bool isA(const void *ClassID) const override {
22    return ClassID == &ID || SymbolFileDWARF::isA(ClassID);
23  }
24  static bool classof(const SymbolFile *obj) { return obj->isA(&ID); }
25  /// \}
26
27  SymbolFileDWARFDwo(SymbolFileDWARF &m_base_symbol_file,
28                     lldb::ObjectFileSP objfile, uint32_t id);
29
30  ~SymbolFileDWARFDwo() override = default;
31
32  DWARFCompileUnit *GetDWOCompileUnitForHash(uint64_t hash);
33
34  void GetObjCMethods(lldb_private::ConstString class_name,
35                      llvm::function_ref<bool(DWARFDIE die)> callback) override;
36
37  llvm::Expected<lldb_private::TypeSystem &>
38  GetTypeSystemForLanguage(lldb::LanguageType language) override;
39
40  DWARFDIE
41  GetDIE(const DIERef &die_ref) override;
42
43  llvm::Optional<uint32_t> GetDwoNum() override { return GetID() >> 32; }
44
45protected:
46  DIEToTypePtr &GetDIEToType() override;
47
48  DIEToVariableSP &GetDIEToVariable() override;
49
50  DIEToClangType &GetForwardDeclDieToClangType() override;
51
52  ClangTypeToDIE &GetForwardDeclClangTypeToDie() override;
53
54  UniqueDWARFASTTypeMap &GetUniqueDWARFASTTypeMap() override;
55
56  lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(
57      const DWARFDeclContext &die_decl_ctx) override;
58
59  lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
60      const DWARFDIE &die, lldb_private::ConstString type_name,
61      bool must_be_implementation) override;
62
63  SymbolFileDWARF &GetBaseSymbolFile() { return m_base_symbol_file; }
64
65  /// If this file contains exactly one compile unit, this function will return
66  /// it. Otherwise it returns nullptr.
67  DWARFCompileUnit *FindSingleCompileUnit();
68
69  SymbolFileDWARF &m_base_symbol_file;
70};
71
72#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDWO_H
73