xref: /freebsd-src/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
10b57cec5SDimitry Andric //===-- DWARFCompileUnit.h --------------------------------------*- C++ -*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
95ffd83dbSDimitry Andric #ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFCOMPILEUNIT_H
105ffd83dbSDimitry Andric #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFCOMPILEUNIT_H
110b57cec5SDimitry Andric 
120b57cec5SDimitry Andric #include "DWARFUnit.h"
130b57cec5SDimitry Andric #include "llvm/Support/Error.h"
140b57cec5SDimitry Andric 
155f757f3fSDimitry Andric namespace llvm {
165f757f3fSDimitry Andric class DWARFAbbreviationDeclarationSet;
175f757f3fSDimitry Andric } // namespace llvm
185f757f3fSDimitry Andric 
195f757f3fSDimitry Andric namespace lldb_private::plugin {
205f757f3fSDimitry Andric namespace dwarf {
210b57cec5SDimitry Andric class DWARFCompileUnit : public DWARFUnit {
220b57cec5SDimitry Andric public:
230b57cec5SDimitry Andric   void BuildAddressRangeTable(DWARFDebugAranges *debug_aranges) override;
240b57cec5SDimitry Andric 
255f757f3fSDimitry Andric   void Dump(Stream *s) const override;
260b57cec5SDimitry Andric 
270b57cec5SDimitry Andric   static bool classof(const DWARFUnit *unit) { return !unit->IsTypeUnit(); }
280b57cec5SDimitry Andric 
29e8d8bef9SDimitry Andric   DWARFCompileUnit &GetNonSkeletonUnit();
30e8d8bef9SDimitry Andric 
31e8d8bef9SDimitry Andric   DWARFDIE LookupAddress(const dw_addr_t address);
32e8d8bef9SDimitry Andric 
330b57cec5SDimitry Andric private:
340b57cec5SDimitry Andric   DWARFCompileUnit(SymbolFileDWARF &dwarf, lldb::user_id_t uid,
35*0fca6ea1SDimitry Andric                    const llvm::DWARFUnitHeader &header,
365f757f3fSDimitry Andric                    const llvm::DWARFAbbreviationDeclarationSet &abbrevs,
37480093f4SDimitry Andric                    DIERef::Section section, bool is_dwo)
38480093f4SDimitry Andric       : DWARFUnit(dwarf, uid, header, abbrevs, section, is_dwo) {}
390b57cec5SDimitry Andric 
405ffd83dbSDimitry Andric   DWARFCompileUnit(const DWARFCompileUnit &) = delete;
415ffd83dbSDimitry Andric   const DWARFCompileUnit &operator=(const DWARFCompileUnit &) = delete;
420b57cec5SDimitry Andric 
430b57cec5SDimitry Andric   friend class DWARFUnit;
440b57cec5SDimitry Andric };
455f757f3fSDimitry Andric } // namespace dwarf
465f757f3fSDimitry Andric } // namespace lldb_private::plugin
470b57cec5SDimitry Andric 
485ffd83dbSDimitry Andric #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFCOMPILEUNIT_H
49