summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp4
-rw-r--r--llvm/lib/DebugInfo/CodeView/TypeSerializer.cpp13
-rw-r--r--llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp15
3 files changed, 21 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 881531078a5..114aea391a8 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -1562,7 +1562,7 @@ TypeIndex CodeViewDebug::lowerTypeEnum(const DICompositeType *Ty) {
EnumeratorCount++;
}
}
- FTI = FLRB.end();
+ FTI = FLRB.end(true);
}
std::string FullName = getFullyQualifiedName(Ty);
@@ -1869,7 +1869,7 @@ CodeViewDebug::lowerRecordFieldList(const DICompositeType *Ty) {
MemberCount++;
}
- TypeIndex FieldTI = FLBR.end();
+ TypeIndex FieldTI = FLBR.end(true);
return std::make_tuple(FieldTI, Info.VShapeTI, MemberCount,
!Info.NestedClasses.empty());
}
diff --git a/llvm/lib/DebugInfo/CodeView/TypeSerializer.cpp b/llvm/lib/DebugInfo/CodeView/TypeSerializer.cpp
index 4894277947b..93c1198e36c 100644
--- a/llvm/lib/DebugInfo/CodeView/TypeSerializer.cpp
+++ b/llvm/lib/DebugInfo/CodeView/TypeSerializer.cpp
@@ -78,6 +78,8 @@ private:
public:
TypeHasher(BumpPtrAllocator &RecordStorage) : RecordStorage(RecordStorage) {}
+ void reset() { HashedRecords.clear(); }
+
/// Takes the bytes of type record, inserts them into the hash table, saves
/// them, and returns a pointer to an identical stable type record along with
/// its type index in the destination stream.
@@ -172,6 +174,17 @@ ArrayRef<ArrayRef<uint8_t>> TypeSerializer::records() const {
return SeenRecords;
}
+void TypeSerializer::reset() {
+ if (Hasher)
+ Hasher->reset();
+ Writer.setOffset(0);
+ CurrentSegment = RecordSegment();
+ FieldListSegments.clear();
+ TypeKind.reset();
+ MemberKind.reset();
+ SeenRecords.clear();
+}
+
TypeIndex TypeSerializer::insertRecordBytes(ArrayRef<uint8_t> &Record) {
assert(!TypeKind.hasValue() && "Already in a type mapping!");
assert(Writer.getOffset() == 0 && "Stream has data already!");
diff --git a/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp b/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp
index 0f8357ca80f..c7f256b838a 100644
--- a/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp
+++ b/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp
@@ -490,21 +490,18 @@ Error TypeStreamMerger::visitKnownRecord(CVType &CVR, FieldListRecord &R) {
assert(DestTypeStream);
// Visit the members inside the field list.
HadUntranslatedMember = false;
- FieldListBuilder = llvm::make_unique<FieldListRecordBuilder>(*DestTypeStream);
+ if (!FieldListBuilder)
+ FieldListBuilder =
+ llvm::make_unique<FieldListRecordBuilder>(*DestTypeStream);
FieldListBuilder->begin();
if (auto EC = codeview::visitMemberRecordStream(CVR.content(), *this))
return EC;
// Write the record if we translated all field list members.
- TypeIndex DestIdx = Untranslated;
- if (!HadUntranslatedMember)
- DestIdx = FieldListBuilder->end();
- else
- FieldListBuilder->reset();
- addMapping(DestIdx);
-
- FieldListBuilder.reset();
+ TypeIndex DestIdx = FieldListBuilder->end(!HadUntranslatedMember);
+ addMapping(HadUntranslatedMember ? Untranslated : DestIdx);
+
return Error::success();
}
OpenPOWER on IntegriCloud