1 //===- DebugSymbolsSubsection.cpp -------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h"
13 using namespace llvm::codeview
;
15 Error
DebugSymbolsSubsectionRef::initialize(BinaryStreamReader Reader
) {
16 return Reader
.readArray(Records
, Reader
.getLength());
19 uint32_t DebugSymbolsSubsection::calculateSerializedSize() const {
23 Error
DebugSymbolsSubsection::commit(BinaryStreamWriter
&Writer
) const {
24 for (const auto &Record
: Records
) {
25 if (auto EC
= Writer
.writeBytes(Record
.RecordData
))
28 return Error::success();
31 void DebugSymbolsSubsection::addSymbol(CVSymbol Symbol
) {
32 Records
.push_back(Symbol
);
33 Length
+= Symbol
.length();