From 591312c5c1a133949285dde012d8cf373ab31b12 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Tue, 30 May 2017 17:13:33 +0000 Subject: [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 --- llvm/lib/DebugInfo/CodeView/DebugChecksumsSubsection.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'llvm/lib/DebugInfo/CodeView/DebugChecksumsSubsection.cpp') diff --git a/llvm/lib/DebugInfo/CodeView/DebugChecksumsSubsection.cpp b/llvm/lib/DebugInfo/CodeView/DebugChecksumsSubsection.cpp index 9e19b4dab14..1a85a339f8c 100644 --- a/llvm/lib/DebugInfo/CodeView/DebugChecksumsSubsection.cpp +++ b/llvm/lib/DebugInfo/CodeView/DebugChecksumsSubsection.cpp @@ -10,7 +10,7 @@ #include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h" #include "llvm/DebugInfo/CodeView/CodeViewError.h" -#include "llvm/DebugInfo/CodeView/StringTable.h" +#include "llvm/DebugInfo/CodeView/DebugStringTableSubsection.h" #include "llvm/Support/BinaryStreamReader.h" using namespace llvm; @@ -48,8 +48,13 @@ Error DebugChecksumsSubsectionRef::initialize(BinaryStreamReader Reader) { return Error::success(); } +Error DebugChecksumsSubsectionRef::initialize(BinaryStreamRef Section) { + BinaryStreamReader Reader(Section); + return initialize(Reader); +} -DebugChecksumsSubsection::DebugChecksumsSubsection(StringTable &Strings) +DebugChecksumsSubsection::DebugChecksumsSubsection( + DebugStringTableSubsection &Strings) : DebugSubsection(DebugSubsectionKind::FileChecksums), Strings(Strings) {} void DebugChecksumsSubsection::addChecksum(StringRef FileName, @@ -75,11 +80,11 @@ void DebugChecksumsSubsection::addChecksum(StringRef FileName, SerializedSize += Len; } -uint32_t DebugChecksumsSubsection::calculateSerializedLength() { +uint32_t DebugChecksumsSubsection::calculateSerializedSize() const { return SerializedSize; } -Error DebugChecksumsSubsection::commit(BinaryStreamWriter &Writer) { +Error DebugChecksumsSubsection::commit(BinaryStreamWriter &Writer) const { for (const auto &FC : Checksums) { FileChecksumEntryHeader Header; Header.ChecksumKind = uint8_t(FC.Kind); -- cgit v1.2.3