SymbolFileDWARFDwo.h revision 355940
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 SymbolFileDWARFDwo_SymbolFileDWARFDwo_h_
10#define SymbolFileDWARFDwo_SymbolFileDWARFDwo_h_
11
12#include "SymbolFileDWARF.h"
13
14class SymbolFileDWARFDwo : public SymbolFileDWARF {
15public:
16  SymbolFileDWARFDwo(lldb::ObjectFileSP objfile, DWARFCompileUnit &dwarf_cu);
17
18  ~SymbolFileDWARFDwo() override = default;
19
20  lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit &dwarf_cu) override;
21
22  DWARFCompileUnit *GetCompileUnit();
23
24  DWARFUnit *
25  GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) override;
26
27  lldb_private::DWARFExpression::LocationListFormat
28  GetLocationListFormat() const override;
29
30  size_t GetObjCMethodDIEOffsets(lldb_private::ConstString class_name,
31                                 DIEArray &method_die_offsets) override;
32
33  lldb_private::TypeSystem *
34  GetTypeSystemForLanguage(lldb::LanguageType language) override;
35
36  DWARFDIE
37  GetDIE(const DIERef &die_ref) override;
38
39  std::unique_ptr<SymbolFileDWARFDwo>
40  GetDwoSymbolFileForCompileUnit(DWARFUnit &dwarf_cu,
41                                 const DWARFDebugInfoEntry &cu_die) override {
42    return nullptr;
43  }
44
45  DWARFCompileUnit *GetBaseCompileUnit() override { return &m_base_dwarf_cu; }
46
47  llvm::Optional<uint32_t> GetDwoNum() override { return GetID() >> 32; }
48
49protected:
50  void LoadSectionData(lldb::SectionType sect_type,
51                       lldb_private::DWARFDataExtractor &data) override;
52
53  DIEToTypePtr &GetDIEToType() override;
54
55  DIEToVariableSP &GetDIEToVariable() override;
56
57  DIEToClangType &GetForwardDeclDieToClangType() override;
58
59  ClangTypeToDIE &GetForwardDeclClangTypeToDie() override;
60
61  UniqueDWARFASTTypeMap &GetUniqueDWARFASTTypeMap() override;
62
63  lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(
64      const DWARFDeclContext &die_decl_ctx) override;
65
66  lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
67      const DWARFDIE &die, lldb_private::ConstString type_name,
68      bool must_be_implementation) override;
69
70  SymbolFileDWARF &GetBaseSymbolFile();
71
72  DWARFCompileUnit *ComputeCompileUnit();
73
74  lldb::ObjectFileSP m_obj_file_sp;
75  DWARFCompileUnit &m_base_dwarf_cu;
76  DWARFCompileUnit *m_cu = nullptr;
77};
78
79#endif // SymbolFileDWARFDwo_SymbolFileDWARFDwo_h_
80