summaryrefslogtreecommitdiff
path: root/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h')
-rw-r--r--include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h b/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h
index 847259c5ceac..49a269d92e35 100644
--- a/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h
+++ b/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h
@@ -52,7 +52,7 @@ public:
DebugSubsectionRecordBuilder(std::unique_ptr<DebugSubsection> Subsection,
CodeViewContainer Container);
uint32_t calculateSerializedLength();
- Error commit(BinaryStreamWriter &Writer);
+ Error commit(BinaryStreamWriter &Writer) const;
private:
std::unique_ptr<DebugSubsection> Subsection;
@@ -62,18 +62,12 @@ private:
} // namespace codeview
template <> struct VarStreamArrayExtractor<codeview::DebugSubsectionRecord> {
- typedef void ContextType;
-
- static Error extract(BinaryStreamRef Stream, uint32_t &Length,
- codeview::DebugSubsectionRecord &Info) {
- // FIXME: We need to pass the container type through to this function, but
- // VarStreamArray doesn't easily support stateful contexts. In practice
- // this isn't super important since the subsection header describes its
- // length and we can just skip it. It's more important when writing.
+ Error operator()(BinaryStreamRef Stream, uint32_t &Length,
+ codeview::DebugSubsectionRecord &Info) {
if (auto EC = codeview::DebugSubsectionRecord::initialize(
Stream, Info, codeview::CodeViewContainer::Pdb))
return EC;
- Length = Info.getRecordLength();
+ Length = alignTo(Info.getRecordLength(), 4);
return Error::success();
}
};