diff options
Diffstat (limited to 'llvm/unittests')
-rw-r--r-- | llvm/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp | 7 | ||||
-rw-r--r-- | llvm/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp | 20 |
2 files changed, 14 insertions, 13 deletions
diff --git a/llvm/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp b/llvm/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp index 04b7bb0ba93..6fb95bdbbfd 100644 --- a/llvm/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp +++ b/llvm/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp @@ -12,7 +12,6 @@ #include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h" #include "llvm/DebugInfo/CodeView/TypeRecord.h" #include "llvm/DebugInfo/CodeView/TypeRecordMapping.h" -#include "llvm/DebugInfo/CodeView/TypeSerializer.h" #include "llvm/DebugInfo/CodeView/TypeTableBuilder.h" #include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h" #include "llvm/DebugInfo/PDB/Native/RawTypes.h" @@ -108,7 +107,7 @@ public: Stream << "Array [" << I << "]"; AR.Name = GlobalState->Strings.save(Stream.str()); GlobalState->Records.push_back(AR); - GlobalState->Indices.push_back(Builder.writeKnownType(AR)); + GlobalState->Indices.push_back(Builder.writeLeafType(AR)); CVType Type(TypeLeafKind::LF_ARRAY, Builder.records().back()); GlobalState->TypeVector.push_back(Type); @@ -363,13 +362,13 @@ TEST_F(RandomAccessVisitorTest, CrossChunkName) { Class.DerivationList = TypeIndex::fromArrayIndex(0); Class.FieldList = TypeIndex::fromArrayIndex(0); Class.VTableShape = TypeIndex::fromArrayIndex(0); - TypeIndex IndexZero = Builder.writeKnownType(Class); + TypeIndex IndexZero = Builder.writeLeafType(Class); // TypeIndex 1 refers to type index 0. ModifierRecord Modifier(TypeRecordKind::Modifier); Modifier.ModifiedType = TypeIndex::fromArrayIndex(0); Modifier.Modifiers = ModifierOptions::Const; - TypeIndex IndexOne = Builder.writeKnownType(Modifier); + TypeIndex IndexOne = Builder.writeLeafType(Modifier); // set up a type stream that refers to the above two serialized records. std::vector<CVType> TypeArray; diff --git a/llvm/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp b/llvm/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp index 125506716d9..8b3889c193f 100644 --- a/llvm/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp +++ b/llvm/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp @@ -9,8 +9,9 @@ #include "llvm/DebugInfo/CodeView/TypeIndexDiscovery.h" -#include "llvm/DebugInfo/CodeView/TypeTableBuilder.h" +#include "llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h" #include "llvm/DebugInfo/CodeView/SymbolSerializer.h" +#include "llvm/DebugInfo/CodeView/TypeTableBuilder.h" #include "llvm/Support/Allocator.h" #include "gmock/gmock.h" @@ -26,12 +27,12 @@ public: void SetUp() override { Refs.clear(); TTB = make_unique<TypeTableBuilder>(Storage); - FLRB = make_unique<FieldListRecordBuilder>(*TTB); + CRB = make_unique<ContinuationRecordBuilder>(); Symbols.clear(); } void TearDown() override { - FLRB.reset(); + CRB.reset(); TTB.reset(); } @@ -55,10 +56,11 @@ protected: } template <typename... T> void writeFieldList(T &&... MemberRecords) { - FLRB->begin(); + CRB->begin(ContinuationRecordKind::FieldList); writeFieldListImpl(std::forward<T>(MemberRecords)...); - FLRB->end(true); - ASSERT_EQ(1u, TTB->records().size()); + auto Records = CRB->end(TTB->nextTypeIndex()); + ASSERT_EQ(1u, Records.size()); + TTB->insertRecordBytes(Records.front().RecordData); discoverAllTypeIndices(); } @@ -140,7 +142,7 @@ private: template <typename RecType, typename... Rest> void writeFieldListImpl(RecType &&Record, Rest &&... Records) { - FLRB->writeMemberType(Record); + CRB->writeMemberType(Record); writeFieldListImpl(std::forward<Rest>(Records)...); } @@ -149,7 +151,7 @@ private: template <typename RecType, typename... Rest> void writeTypeRecordsImpl(RecType &&Record, Rest &&... Records) { - TTB->writeKnownType(Record); + TTB->writeLeafType(Record); writeTypeRecordsImpl(std::forward<Rest>(Records)...); } @@ -164,7 +166,7 @@ private: } std::vector<SmallVector<TiReference, 4>> Refs; - std::unique_ptr<FieldListRecordBuilder> FLRB; + std::unique_ptr<ContinuationRecordBuilder> CRB; std::vector<CVSymbol> Symbols; BumpPtrAllocator Storage; }; |