summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-05-02 16:56:09 +0000
committerZachary Turner <zturner@google.com>2017-05-02 16:56:09 +0000
commitedef14510e36f307dff256faf030abbfb27be674 (patch)
tree5fd726720d7bd48b7b9059d2ac99826ffffb1580 /llvm/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp
parentbb34f278a2e12f8af526b34725fd2b61c5c8c189 (diff)
downloadbcm5719-llvm-edef14510e36f307dff256faf030abbfb27be674.tar.gz
bcm5719-llvm-edef14510e36f307dff256faf030abbfb27be674.zip
[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
Diffstat (limited to 'llvm/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp')
-rw-r--r--llvm/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp7
1 files changed, 6 insertions, 1 deletions
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();
}
OpenPOWER on IntegriCloud