Make TypeTableBuilder inherit from TypeCollection.
A couple of places in LLD were passing references to
TypeTableCollections around, which makes it hard to change the
implementation at runtime. However, these cases only needed to
iterate over the types in the collection, and TypeCollection
already provides a handy abstract interface for this purpose.
By implementing this interface, we can get rid of the need to
pass TypeTableBuilder references around, which should allow us
to swap the implementation at runtime in subsequent patches.
llvm-svn: 319345
diff --git a/llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp b/llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp
index 7a5cc2c..43dad61 100644
--- a/llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp
+++ b/llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp
@@ -1020,11 +1020,11 @@
auto &DestTpi = Builder.getTpiBuilder();
auto &DestIpi = Builder.getIpiBuilder();
- MergedTpi.ForEachRecord([&DestTpi](TypeIndex TI, ArrayRef<uint8_t> Data) {
- DestTpi.addTypeRecord(Data, None);
+ MergedTpi.ForEachRecord([&DestTpi](TypeIndex TI, const CVType &Type) {
+ DestTpi.addTypeRecord(Type.RecordData, None);
});
- MergedIpi.ForEachRecord([&DestIpi](TypeIndex TI, ArrayRef<uint8_t> Data) {
- DestIpi.addTypeRecord(Data, None);
+ MergedIpi.ForEachRecord([&DestIpi](TypeIndex TI, const CVType &Type) {
+ DestIpi.addTypeRecord(Type.RecordData, None);
});
Builder.getInfoBuilder().addFeature(PdbRaw_FeatureSig::VC140);