1 //===- DebugSymbolsSubsection.cpp -------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h" 11 12 using namespace llvm; 13 using namespace llvm::codeview; 14 initialize(BinaryStreamReader Reader)15Error DebugSymbolsSubsectionRef::initialize(BinaryStreamReader Reader) { 16 return Reader.readArray(Records, Reader.getLength()); 17 } 18 calculateSerializedSize() const19uint32_t DebugSymbolsSubsection::calculateSerializedSize() const { 20 return Length; 21 } 22 commit(BinaryStreamWriter & Writer) const23Error 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 addSymbol(CVSymbol Symbol)31void DebugSymbolsSubsection::addSymbol(CVSymbol Symbol) { 32 Records.push_back(Symbol); 33 Length += Symbol.length(); 34 }