diff options
author | Zachary Turner <zturner@google.com> | 2017-11-30 18:39:50 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-11-30 18:39:50 +0000 |
commit | 47856b25a74f4676cbcd3a38b9db221dc5a182b3 (patch) | |
tree | c784088532b523b226dde2e77619e4ca21ce78fe /lib/ObjectYAML | |
parent | 69d3274f508e17a5c37367b9414211fa160753d4 (diff) |
Split TypeTableBuilder into two classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319456 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ObjectYAML')
-rw-r--r-- | lib/ObjectYAML/CodeViewYAMLTypes.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/ObjectYAML/CodeViewYAMLTypes.cpp b/lib/ObjectYAML/CodeViewYAMLTypes.cpp index 84b52b463c4..887328cf508 100644 --- a/lib/ObjectYAML/CodeViewYAMLTypes.cpp +++ b/lib/ObjectYAML/CodeViewYAMLTypes.cpp @@ -17,13 +17,13 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" #include "llvm/BinaryFormat/COFF.h" +#include "llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h" #include "llvm/DebugInfo/CodeView/CVTypeVisitor.h" #include "llvm/DebugInfo/CodeView/CodeView.h" #include "llvm/DebugInfo/CodeView/CodeViewError.h" #include "llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h" #include "llvm/DebugInfo/CodeView/TypeDeserializer.h" #include "llvm/DebugInfo/CodeView/TypeIndex.h" -#include "llvm/DebugInfo/CodeView/TypeTableBuilder.h" #include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/BinaryStreamReader.h" @@ -83,7 +83,7 @@ struct LeafRecordBase { virtual ~LeafRecordBase() = default; virtual void map(yaml::IO &io) = 0; - virtual CVType toCodeViewRecord(TypeTableBuilder &TS) const = 0; + virtual CVType toCodeViewRecord(AppendingTypeTableBuilder &TS) const = 0; virtual Error fromCodeViewRecord(CVType Type) = 0; }; @@ -97,7 +97,7 @@ template <typename T> struct LeafRecordImpl : public LeafRecordBase { return TypeDeserializer::deserializeAs<T>(Type, Record); } - CVType toCodeViewRecord(TypeTableBuilder &TS) const override { + CVType toCodeViewRecord(AppendingTypeTableBuilder &TS) const override { TS.writeLeafType(Record); return CVType(Kind, TS.records().back()); } @@ -109,7 +109,7 @@ template <> struct LeafRecordImpl<FieldListRecord> : public LeafRecordBase { explicit LeafRecordImpl(TypeLeafKind K) : LeafRecordBase(K) {} void map(yaml::IO &io) override; - CVType toCodeViewRecord(TypeTableBuilder &TS) const override; + CVType toCodeViewRecord(AppendingTypeTableBuilder &TS) const override; Error fromCodeViewRecord(CVType Type) override; std::vector<MemberRecord> Members; @@ -489,8 +489,8 @@ Error LeafRecordImpl<FieldListRecord>::fromCodeViewRecord(CVType Type) { return visitMemberRecordStream(Type.content(), V); } -CVType -LeafRecordImpl<FieldListRecord>::toCodeViewRecord(TypeTableBuilder &TS) const { +CVType LeafRecordImpl<FieldListRecord>::toCodeViewRecord( + AppendingTypeTableBuilder &TS) const { ContinuationRecordBuilder CRB; CRB.begin(ContinuationRecordKind::FieldList); for (const auto &Member : Members) { @@ -682,7 +682,8 @@ Expected<LeafRecord> LeafRecord::fromCodeViewRecord(CVType Type) { return make_error<CodeViewError>(cv_error_code::corrupt_record); } -CVType LeafRecord::toCodeViewRecord(TypeTableBuilder &Serializer) const { +CVType +LeafRecord::toCodeViewRecord(AppendingTypeTableBuilder &Serializer) const { return Leaf->toCodeViewRecord(Serializer); } @@ -782,7 +783,7 @@ llvm::CodeViewYAML::fromDebugT(ArrayRef<uint8_t> DebugT) { ArrayRef<uint8_t> llvm::CodeViewYAML::toDebugT(ArrayRef<LeafRecord> Leafs, BumpPtrAllocator &Alloc) { - TypeTableBuilder TS(Alloc, false); + AppendingTypeTableBuilder TS(Alloc); uint32_t Size = sizeof(uint32_t); for (const auto &Leaf : Leafs) { CVType T = Leaf.Leaf->toCodeViewRecord(TS); |