summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h3
-rw-r--r--llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp5
2 files changed, 5 insertions, 3 deletions
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h
index de7bc44ae91..c7d417063e4 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h
@@ -82,12 +82,13 @@ public:
class FieldListRecordBuilder {
TypeTableBuilder &TypeTable;
+ BumpPtrAllocator Allocator;
TypeSerializer TempSerializer;
CVType Type;
public:
explicit FieldListRecordBuilder(TypeTableBuilder &TypeTable)
- : TypeTable(TypeTable), TempSerializer(TypeTable.getAllocator()) {
+ : TypeTable(TypeTable), TempSerializer(Allocator) {
Type.Type = TypeLeafKind::LF_FIELDLIST;
}
diff --git a/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp b/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp
index c3f8973abb8..152634056bd 100644
--- a/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp
+++ b/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp
@@ -416,6 +416,8 @@ Error TypeStreamMerger::visitKnownRecord(CVType &, FieldListRecord &R) {
assert(DestTypeStream);
// Visit the members inside the field list.
HadUntranslatedMember = false;
+ FieldListBuilder = llvm::make_unique<FieldListRecordBuilder>(*DestTypeStream);
+
FieldListBuilder->begin();
if (auto EC = codeview::visitMemberRecordStream(R.Data, *this))
return EC;
@@ -428,6 +430,7 @@ Error TypeStreamMerger::visitKnownRecord(CVType &, FieldListRecord &R) {
FieldListBuilder->reset();
addMapping(DestIdx);
+ FieldListBuilder.reset();
return Error::success();
}
@@ -496,7 +499,6 @@ Error TypeStreamMerger::visitUnknownType(CVType &Rec) {
Error TypeStreamMerger::mergeTypeRecords(TypeTableBuilder &Dest,
TypeCollection &Types) {
DestTypeStream = &Dest;
- FieldListBuilder = llvm::make_unique<FieldListRecordBuilder>(Dest);
return doit(Types);
}
@@ -515,7 +517,6 @@ Error TypeStreamMerger::mergeTypesAndIds(TypeTableBuilder &DestIds,
TypeCollection &IdsAndTypes) {
DestIdStream = &DestIds;
DestTypeStream = &DestTypes;
- FieldListBuilder = llvm::make_unique<FieldListRecordBuilder>(DestTypes);
return doit(IdsAndTypes);
}
OpenPOWER on IntegriCloud