35 lines · cpp
1//===- DebugSymbolsSubsection.cpp -------------------------------*- 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-exception6//7//===----------------------------------------------------------------------===//8 9#include "llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h"10#include "llvm/Support/BinaryStreamWriter.h"11 12using namespace llvm;13using namespace llvm::codeview;14 15Error DebugSymbolsSubsectionRef::initialize(BinaryStreamReader Reader) {16 return Reader.readArray(Records, Reader.getLength());17}18 19uint32_t DebugSymbolsSubsection::calculateSerializedSize() const {20 return Length;21}22 23Error DebugSymbolsSubsection::commit(BinaryStreamWriter &Writer) const {24 for (const auto &Record : Records) {25 if (auto EC = Writer.writeBytes(Record.RecordData))26 return EC;27 }28 return Error::success();29}30 31void DebugSymbolsSubsection::addSymbol(CVSymbol Symbol) {32 Records.push_back(Symbol);33 Length += Symbol.length();34}35