Recommit [NFC] Better encapsulation of llvm::Optional Storage
[llvm-complete.git] / include / llvm / DebugInfo / DWARF / DWARFTypeUnit.h
blob90d89375fd353bb2d5d0cffba42b0112a0b211de
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 //===----------------------------------------------------------------------===//
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"
16 #include <cstdint>
18 namespace llvm {
20 class DWARFContext;
21 class DWARFDebugAbbrev;
22 struct DWARFSection;
23 class raw_ostream;
25 class DWARFTypeUnit : public DWARFUnit {
26 public:
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