Skip to content

Commit 39eec46

Browse files
committed
Revert "Write the TPI stream from a PDB to Yaml."
This is hitting a "use of undeclared identifier 'skipPadding' error locally and on some bots. This reverts r278869. llvm-svn: 278871
1 parent dcbce9c commit 39eec46

28 files changed

+260
-2059
lines changed

llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ class CVTypeVisitor {
2828
/// Visits the type records in Data. Sets the error flag on parse failures.
2929
Error visitTypeStream(const CVTypeArray &Types);
3030

31-
Error visitFieldListMemberStream(ArrayRef<uint8_t> FieldList);
32-
3331
private:
3432
/// The interface to the class that gets notified of each visitation.
3533
TypeVisitorCallbacks &Callbacks;

llvm/include/llvm/DebugInfo/CodeView/EnumTables.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
namespace llvm {
2121
namespace codeview {
2222
ArrayRef<EnumEntry<SymbolKind>> getSymbolTypeNames();
23-
ArrayRef<EnumEntry<TypeLeafKind>> getTypeLeafNames();
2423
ArrayRef<EnumEntry<uint16_t>> getRegisterNames();
2524
ArrayRef<EnumEntry<uint8_t>> getProcSymFlagNames();
2625
ArrayRef<EnumEntry<uint16_t>> getLocalFlagNames();

llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
namespace llvm {
1717
namespace codeview {
18-
class TypeDeserializer : public TypeVisitorCallbacks {
18+
class TypeDeserializerBase : public TypeVisitorCallbacks {
1919
public:
20-
explicit TypeDeserializer(TypeVisitorCallbacks &Recipient)
20+
explicit TypeDeserializerBase(TypeVisitorCallbacks &Recipient)
2121
: Recipient(Recipient) {}
2222

2323
Error visitTypeBegin(const CVRecord<TypeLeafKind> &Record) override {
@@ -62,6 +62,39 @@ class TypeDeserializer : public TypeVisitorCallbacks {
6262
return Recipient.visitKnownRecord(CVR, Record);
6363
}
6464
};
65+
66+
class TypeDeserializer : public TypeDeserializerBase {
67+
public:
68+
explicit TypeDeserializer(TypeVisitorCallbacks &Recipient)
69+
: TypeDeserializerBase(Recipient) {}
70+
71+
/// FieldList records need special handling. For starters, they do not
72+
/// describe their own length, so a different extraction algorithm is
73+
/// necessary. Secondly, a single FieldList record will result in the
74+
/// deserialization of many records. So even though the top level visitor
75+
/// calls visitFieldBegin() on a single record, multiple records get visited
76+
/// through the callback interface.
77+
Error visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
78+
FieldListRecord &Record) override;
79+
80+
private:
81+
template <typename T>
82+
Error visitKnownMember(ArrayRef<uint8_t> &Data, TypeLeafKind Kind,
83+
T &Record) {
84+
ArrayRef<uint8_t> OldData = Data;
85+
if (auto EC = deserializeRecord(Data, Kind, Record))
86+
return EC;
87+
assert(Data.size() < OldData.size());
88+
89+
CVRecord<TypeLeafKind> CVR;
90+
CVR.Length = OldData.size() - Data.size();
91+
CVR.Data = OldData.slice(0, CVR.Length);
92+
CVR.RawData = CVR.Data;
93+
return Recipient.visitKnownRecord(CVR, Record);
94+
}
95+
96+
Error skipPadding(ArrayRef<uint8_t> &Data);
97+
};
6598
}
6699
}
67100

llvm/include/llvm/DebugInfo/CodeView/TypeDumper.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ class CVTypeDumper : public TypeVisitorCallbacks {
8787

8888
ScopedPrinter *W;
8989

90-
bool IsInFieldList = false;
9190
bool PrintRecordBytes = false;
9291

9392
/// Name of the current type. Only valid before visitTypeEnd.

0 commit comments

Comments
 (0)