1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/lib/DebugInfo/CodeView/DebugSymbolsSubsection.cpp
Zachary Turner 4006e15ad2 [CodeView] Add more DebugSubsection implementations.
This adds implementations for Symbols and FrameData, and renames
the existing codeview::StringTable class to conform to the
DebugSectionStringTable convention.

llvm-svn: 304222
2017-05-30 17:13:33 +00:00

34 lines
1013 B
C++

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