1 //===-- DWARFTypeUnit.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_DWARFTYPEUNIT_H 10 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFTYPEUNIT_H 11 12 #include "DWARFUnit.h" 13 #include "llvm/Support/Error.h" 14 15 namespace llvm { 16 class DWARFAbbreviationDeclarationSet; 17 } // namespace llvm 18 19 namespace lldb_private::plugin { 20 namespace dwarf { 21 class DWARFTypeUnit : public DWARFUnit { 22 public: BuildAddressRangeTable(DWARFDebugAranges * debug_aranges)23 void BuildAddressRangeTable(DWARFDebugAranges *debug_aranges) override {} 24 25 void Dump(Stream *s) const override; 26 GetTypeHash()27 uint64_t GetTypeHash() { return m_header.getTypeHash(); } 28 GetTypeOffset()29 dw_offset_t GetTypeOffset() { return GetOffset() + m_header.getTypeOffset(); } 30 classof(const DWARFUnit * unit)31 static bool classof(const DWARFUnit *unit) { return unit->IsTypeUnit(); } 32 33 private: DWARFTypeUnit(SymbolFileDWARF & dwarf,lldb::user_id_t uid,const llvm::DWARFUnitHeader & header,const llvm::DWARFAbbreviationDeclarationSet & abbrevs,DIERef::Section section,bool is_dwo)34 DWARFTypeUnit(SymbolFileDWARF &dwarf, lldb::user_id_t uid, 35 const llvm::DWARFUnitHeader &header, 36 const llvm::DWARFAbbreviationDeclarationSet &abbrevs, 37 DIERef::Section section, bool is_dwo) 38 : DWARFUnit(dwarf, uid, header, abbrevs, section, is_dwo) {} 39 40 friend class DWARFUnit; 41 }; 42 } // namespace dwarf 43 } // namespace lldb_private::plugin 44 45 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFTYPEUNIT_H 46