[llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710)
[llvm-project.git] / llvm / lib / DebugInfo / CodeView / DebugSymbolsSubsection.cpp
blob2b20b3e95db6fe5f47cb4820a3cf461fc0299858
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"
10 #include "llvm/Support/BinaryStreamWriter.h"
12 using namespace llvm;
13 using namespace llvm::codeview;
15 Error DebugSymbolsSubsectionRef::initialize(BinaryStreamReader Reader) {
16 return Reader.readArray(Records, Reader.getLength());
19 uint32_t DebugSymbolsSubsection::calculateSerializedSize() const {
20 return Length;
23 Error DebugSymbolsSubsection::commit(BinaryStreamWriter &Writer) const {
24 for (const auto &Record : Records) {
25 if (auto EC = Writer.writeBytes(Record.RecordData))
26 return EC;
28 return Error::success();
31 void DebugSymbolsSubsection::addSymbol(CVSymbol Symbol) {
32 Records.push_back(Symbol);
33 Length += Symbol.length();