1 //===- DWARFTypeUnit.h ------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_DEBUGINFO_DWARF_DWARFTYPEUNIT_H
10 #define LLVM_DEBUGINFO_DWARF_DWARFTYPEUNIT_H
12 #include "llvm/ADT/StringRef.h"
13 #include "llvm/DebugInfo/DWARF/DWARFUnit.h"
14 #include "llvm/DebugInfo/DWARF/DWARFUnitIndex.h"
15 #include "llvm/Support/DataExtractor.h"
21 class DWARFDebugAbbrev;
25 class DWARFTypeUnit : public DWARFUnit {
27 DWARFTypeUnit(DWARFContext &Context, const DWARFSection &Section,
28 const DWARFUnitHeader &Header, const DWARFDebugAbbrev *DA,
29 const DWARFSection *RS, const DWARFSection *LocSection,
30 StringRef SS, const DWARFSection &SOS, const DWARFSection *AOS,
31 const DWARFSection &LS, bool LE, bool IsDWO,
32 const DWARFUnitVector &UnitVector)
33 : DWARFUnit(Context, Section, Header, DA, RS, LocSection, SS, SOS, AOS,
34 LS, LE, IsDWO, UnitVector) {}
36 uint64_t getTypeHash() const { return getHeader().getTypeHash(); }
37 uint32_t getTypeOffset() const { return getHeader().getTypeOffset(); }
39 void dump(raw_ostream &OS, DIDumpOptions DumpOpts = {}) override;
40 // Enable LLVM-style RTTI.
41 static bool classof(const DWARFUnit *U) { return U->isTypeUnit(); }
44 } // end namespace llvm
46 #endif // LLVM_DEBUGINFO_DWARF_DWARFTYPEUNIT_H