1*3226fe95SZachary Turner //===- DebugSymbolRVASubsection.cpp ------------------------------*- C++-*-===// 2*3226fe95SZachary Turner // 3*3226fe95SZachary Turner // The LLVM Compiler Infrastructure 4*3226fe95SZachary Turner // 5*3226fe95SZachary Turner // This file is distributed under the University of Illinois Open Source 6*3226fe95SZachary Turner // License. See LICENSE.TXT for details. 7*3226fe95SZachary Turner // 8*3226fe95SZachary Turner //===----------------------------------------------------------------------===// 9*3226fe95SZachary Turner 10*3226fe95SZachary Turner #include "llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h" 11*3226fe95SZachary Turner 12*3226fe95SZachary Turner using namespace llvm; 13*3226fe95SZachary Turner using namespace llvm::codeview; 14*3226fe95SZachary Turner 15*3226fe95SZachary Turner DebugSymbolRVASubsectionRef::DebugSymbolRVASubsectionRef() 16*3226fe95SZachary Turner : DebugSubsectionRef(DebugSubsectionKind::CoffSymbolRVA) {} 17*3226fe95SZachary Turner 18*3226fe95SZachary Turner Error DebugSymbolRVASubsectionRef::initialize(BinaryStreamReader &Reader) { 19*3226fe95SZachary Turner return Reader.readArray(RVAs, Reader.bytesRemaining() / sizeof(uint32_t)); 20*3226fe95SZachary Turner } 21*3226fe95SZachary Turner 22*3226fe95SZachary Turner DebugSymbolRVASubsection::DebugSymbolRVASubsection() 23*3226fe95SZachary Turner : DebugSubsection(DebugSubsectionKind::CoffSymbolRVA) {} 24*3226fe95SZachary Turner 25*3226fe95SZachary Turner Error DebugSymbolRVASubsection::commit(BinaryStreamWriter &Writer) const { 26*3226fe95SZachary Turner return Writer.writeArray(makeArrayRef(RVAs)); 27*3226fe95SZachary Turner } 28*3226fe95SZachary Turner 29*3226fe95SZachary Turner uint32_t DebugSymbolRVASubsection::calculateSerializedSize() const { 30*3226fe95SZachary Turner return RVAs.size() * sizeof(uint32_t); 31*3226fe95SZachary Turner } 32