From edef14510e36f307dff256faf030abbfb27be674 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Tue, 2 May 2017 16:56:09 +0000 Subject: [PDB/CodeView] Read/write codeview inlinee line information. Previously we wrote line information and file checksum information, but we did not write information about inlinee lines and functions. This patch adds support for that. llvm-svn: 301936 --- llvm/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'llvm/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp') diff --git a/llvm/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp b/llvm/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp index 79e5b9d690d..c349e7ecce9 100644 --- a/llvm/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp +++ b/llvm/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp @@ -68,7 +68,10 @@ void ModuleDebugFileChecksumFragment::addChecksum(uint32_t StringTableOffset, // This maps the offset of this string in the string table to the offset // of this checksum entry in the checksum buffer. OffsetMap[StringTableOffset] = SerializedSize; - SerializedSize += sizeof(FileChecksumEntryHeader) + Bytes.size(); + assert(SerializedSize % 4 == 0); + + uint32_t Len = alignTo(sizeof(FileChecksumEntryHeader) + Bytes.size(), 4); + SerializedSize += Len; } uint32_t ModuleDebugFileChecksumFragment::calculateSerializedLength() { @@ -85,6 +88,8 @@ Error ModuleDebugFileChecksumFragment::commit(BinaryStreamWriter &Writer) { return EC; if (auto EC = Writer.writeArray(makeArrayRef(FC.Checksum))) return EC; + if (auto EC = Writer.padToAlignment(4)) + return EC; } return Error::success(); } -- cgit v1.2.3