1 //===- DebugSymbolRVASubsection.cpp ---------------------------------------===//
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/DebugSymbolRVASubsection.h"
11 #include "llvm/ADT/ArrayRef.h"
12 #include "llvm/DebugInfo/CodeView/CodeView.h"
13 #include "llvm/Support/BinaryStreamReader.h"
14 #include "llvm/Support/BinaryStreamWriter.h"
18 using namespace llvm::codeview
;
20 DebugSymbolRVASubsectionRef::DebugSymbolRVASubsectionRef()
21 : DebugSubsectionRef(DebugSubsectionKind::CoffSymbolRVA
) {}
23 Error
DebugSymbolRVASubsectionRef::initialize(BinaryStreamReader
&Reader
) {
24 return Reader
.readArray(RVAs
, Reader
.bytesRemaining() / sizeof(uint32_t));
27 DebugSymbolRVASubsection::DebugSymbolRVASubsection()
28 : DebugSubsection(DebugSubsectionKind::CoffSymbolRVA
) {}
30 Error
DebugSymbolRVASubsection::commit(BinaryStreamWriter
&Writer
) const {
31 return Writer
.writeArray(makeArrayRef(RVAs
));
34 uint32_t DebugSymbolRVASubsection::calculateSerializedSize() const {
35 return RVAs
.size() * sizeof(uint32_t);