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 LLVM_DEBUGINFO_DWARF_DWARFTYPEUNIT_H
10#define LLVM_DEBUGINFO_DWARF_DWARFTYPEUNIT_H
11
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"
16#include <cstdint>
17
18namespace llvm {
19
20class DWARFContext;
21class DWARFDebugAbbrev;
22struct DWARFSection;
23class raw_ostream;
24
25class DWARFTypeUnit : public DWARFUnit {
26public:
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) {}
35
36 uint64_t getTypeHash() const { return getHeader().getTypeHash(); }
37 uint64_t getTypeOffset() const { return getHeader().getTypeOffset(); }
38
39 void dump(raw_ostream &OS, DIDumpOptions DumpOpts = {}) override;
40 // Enable LLVM-style RTTI.
41 static bool classof(const DWARFUnit *U) { return U->isTypeUnit(); }
42};
43
44} // end namespace llvm
45
46#endif // LLVM_DEBUGINFO_DWARF_DWARFTYPEUNIT_H
47