[ThinLTO] Add code comment. NFC
[llvm-complete.git] / lib / DebugInfo / CodeView / DebugSymbolsSubsection.cpp
blobc833103663e4fa602b5bc69d360c00c78235eee4
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-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h"
11 using namespace llvm;
12 using namespace llvm::codeview;
14 Error DebugSymbolsSubsectionRef::initialize(BinaryStreamReader Reader) {
15 return Reader.readArray(Records, Reader.getLength());
18 uint32_t DebugSymbolsSubsection::calculateSerializedSize() const {
19 return Length;
22 Error DebugSymbolsSubsection::commit(BinaryStreamWriter &Writer) const {
23 for (const auto &Record : Records) {
24 if (auto EC = Writer.writeBytes(Record.RecordData))
25 return EC;
27 return Error::success();
30 void DebugSymbolsSubsection::addSymbol(CVSymbol Symbol) {
31 Records.push_back(Symbol);
32 Length += Symbol.length();