1 //===- DWARFTypeUnit.h ------------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef LLVM_DEBUGINFO_DWARF_DWARFTYPEUNIT_H 11 #define LLVM_DEBUGINFO_DWARF_DWARFTYPEUNIT_H 12 13 #include "llvm/ADT/StringRef.h" 14 #include "llvm/DebugInfo/DWARF/DWARFUnit.h" 15 #include "llvm/DebugInfo/DWARF/DWARFUnitIndex.h" 16 #include "llvm/Support/DataExtractor.h" 17 #include <cstdint> 18 19 namespace llvm { 20 21 class DWARFContext; 22 class DWARFDebugAbbrev; 23 struct DWARFSection; 24 class raw_ostream; 25 26 class DWARFTypeUnit : public DWARFUnit { 27 public: DWARFTypeUnit(DWARFContext & Context,const DWARFSection & Section,const DWARFUnitHeader & Header,const DWARFDebugAbbrev * DA,const DWARFSection * RS,const DWARFSection * LocSection,StringRef SS,const DWARFSection & SOS,const DWARFSection * AOS,const DWARFSection & LS,bool LE,bool IsDWO,const DWARFUnitVector & UnitVector)28 DWARFTypeUnit(DWARFContext &Context, const DWARFSection &Section, 29 const DWARFUnitHeader &Header, const DWARFDebugAbbrev *DA, 30 const DWARFSection *RS, const DWARFSection *LocSection, 31 StringRef SS, const DWARFSection &SOS, const DWARFSection *AOS, 32 const DWARFSection &LS, bool LE, bool IsDWO, 33 const DWARFUnitVector &UnitVector) 34 : DWARFUnit(Context, Section, Header, DA, RS, LocSection, SS, SOS, AOS, 35 LS, LE, IsDWO, UnitVector) {} 36 getTypeHash()37 uint64_t getTypeHash() const { return getHeader().getTypeHash(); } getTypeOffset()38 uint32_t getTypeOffset() const { return getHeader().getTypeOffset(); } 39 40 void dump(raw_ostream &OS, DIDumpOptions DumpOpts = {}) override; 41 // Enable LLVM-style RTTI. classof(const DWARFUnit * U)42 static bool classof(const DWARFUnit *U) { return U->isTypeUnit(); } 43 }; 44 45 } // end namespace llvm 46 47 #endif // LLVM_DEBUGINFO_DWARF_DWARFTYPEUNIT_H 48