]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lldb / source / Plugins / SymbolFile / DWARF / SymbolFileDWARFDwo.h
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
14 class SymbolFileDWARFDwo : public SymbolFileDWARF {
15   /// LLVM RTTI support.
16   static char ID;
17
18 public:
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(lldb::ObjectFileSP objfile, DWARFCompileUnit &dwarf_cu);
28
29   ~SymbolFileDWARFDwo() override = default;
30
31   lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit &dwarf_cu) override;
32
33   DWARFCompileUnit *GetCompileUnit();
34
35   DWARFUnit *
36   GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) override;
37
38   size_t GetObjCMethodDIEOffsets(lldb_private::ConstString class_name,
39                                  DIEArray &method_die_offsets) override;
40
41   llvm::Expected<lldb_private::TypeSystem &>
42   GetTypeSystemForLanguage(lldb::LanguageType language) override;
43
44   DWARFDIE
45   GetDIE(const DIERef &die_ref) override;
46
47   DWARFCompileUnit *GetBaseCompileUnit() override { return &m_base_dwarf_cu; }
48
49   llvm::Optional<uint32_t> GetDwoNum() override { return GetID() >> 32; }
50
51 protected:
52   void LoadSectionData(lldb::SectionType sect_type,
53                        lldb_private::DWARFDataExtractor &data) override;
54
55   DIEToTypePtr &GetDIEToType() override;
56
57   DIEToVariableSP &GetDIEToVariable() override;
58
59   DIEToClangType &GetForwardDeclDieToClangType() override;
60
61   ClangTypeToDIE &GetForwardDeclClangTypeToDie() override;
62
63   UniqueDWARFASTTypeMap &GetUniqueDWARFASTTypeMap() override;
64
65   lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(
66       const DWARFDeclContext &die_decl_ctx) override;
67
68   lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
69       const DWARFDIE &die, lldb_private::ConstString type_name,
70       bool must_be_implementation) override;
71
72   SymbolFileDWARF &GetBaseSymbolFile();
73
74   DWARFCompileUnit *ComputeCompileUnit();
75
76   DWARFCompileUnit &m_base_dwarf_cu;
77   DWARFCompileUnit *m_cu = nullptr;
78 };
79
80 #endif // SymbolFileDWARFDwo_SymbolFileDWARFDwo_h_