blob: 5f91b68f3ad8afba160bc54e4a2d798f527391cc [file] [log] [blame]
Zachary Turner3226fe92017-06-09 20:46:52 +00001//===- DebugSymbolRVASubsection.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/DebugSymbolRVASubsection.h"
11
12using namespace llvm;
13using namespace llvm::codeview;
14
15DebugSymbolRVASubsectionRef::DebugSymbolRVASubsectionRef()
16 : DebugSubsectionRef(DebugSubsectionKind::CoffSymbolRVA) {}
17
18Error DebugSymbolRVASubsectionRef::initialize(BinaryStreamReader &Reader) {
19 return Reader.readArray(RVAs, Reader.bytesRemaining() / sizeof(uint32_t));
20}
21
22DebugSymbolRVASubsection::DebugSymbolRVASubsection()
23 : DebugSubsection(DebugSubsectionKind::CoffSymbolRVA) {}
24
25Error DebugSymbolRVASubsection::commit(BinaryStreamWriter &Writer) const {
26 return Writer.writeArray(makeArrayRef(RVAs));
27}
28
29uint32_t DebugSymbolRVASubsection::calculateSerializedSize() const {
30 return RVAs.size() * sizeof(uint32_t);
31}