1319230Sdim//===- DebugSymbolsSubsection.h --------------------------------*- C++ -*-===// 2319230Sdim// 3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4353358Sdim// See https://llvm.org/LICENSE.txt for license information. 5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6319230Sdim// 7319230Sdim//===----------------------------------------------------------------------===// 8319230Sdim 9319230Sdim#ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLSSUBSECTION_H 10319230Sdim#define LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLSSUBSECTION_H 11319230Sdim 12319230Sdim#include "llvm/DebugInfo/CodeView/DebugSubsection.h" 13319230Sdim#include "llvm/DebugInfo/CodeView/SymbolRecord.h" 14319230Sdim#include "llvm/Support/Error.h" 15319230Sdim 16319230Sdimnamespace llvm { 17319230Sdimnamespace codeview { 18319230Sdimclass DebugSymbolsSubsectionRef final : public DebugSubsectionRef { 19319230Sdimpublic: 20319230Sdim DebugSymbolsSubsectionRef() 21319230Sdim : DebugSubsectionRef(DebugSubsectionKind::Symbols) {} 22319230Sdim 23319230Sdim static bool classof(const DebugSubsectionRef *S) { 24319230Sdim return S->kind() == DebugSubsectionKind::Symbols; 25319230Sdim } 26319230Sdim 27319230Sdim Error initialize(BinaryStreamReader Reader); 28319230Sdim 29319799Sdim CVSymbolArray::Iterator begin() const { return Records.begin(); } 30319799Sdim CVSymbolArray::Iterator end() const { return Records.end(); } 31319799Sdim 32319230Sdimprivate: 33319230Sdim CVSymbolArray Records; 34319230Sdim}; 35319230Sdim 36319230Sdimclass DebugSymbolsSubsection final : public DebugSubsection { 37319230Sdimpublic: 38319230Sdim DebugSymbolsSubsection() : DebugSubsection(DebugSubsectionKind::Symbols) {} 39319230Sdim static bool classof(const DebugSubsection *S) { 40319230Sdim return S->kind() == DebugSubsectionKind::Symbols; 41319230Sdim } 42319230Sdim 43319230Sdim uint32_t calculateSerializedSize() const override; 44319230Sdim Error commit(BinaryStreamWriter &Writer) const override; 45319230Sdim 46319230Sdim void addSymbol(CVSymbol Symbol); 47319230Sdim 48319230Sdimprivate: 49319230Sdim uint32_t Length = 0; 50319230Sdim std::vector<CVSymbol> Records; 51319230Sdim}; 52319230Sdim} 53319230Sdim} 54319230Sdim 55319230Sdim#endif 56