[llvm-pdbdump] Dump the IPI stream and all records.
llvm-svn: 270661
diff --git a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
index 9da9c81..594739f 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
@@ -289,13 +289,22 @@
Expected<TpiStream &> PDBFile::getPDBTpiStream() {
if (!Tpi) {
- Tpi.reset(new TpiStream(*this));
+ Tpi.reset(new TpiStream(*this, StreamTPI));
if (auto EC = Tpi->reload())
return std::move(EC);
}
return *Tpi;
}
+Expected<TpiStream &> PDBFile::getPDBIpiStream() {
+ if (!Ipi) {
+ Ipi.reset(new TpiStream(*this, StreamIPI));
+ if (auto EC = Ipi->reload())
+ return std::move(EC);
+ }
+ return *Ipi;
+}
+
Expected<PublicsStream &> PDBFile::getPDBPublicsStream() {
if (!Publics) {
auto DbiS = getPDBDbiStream();
diff --git a/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp
index ed988bb..8ce8c01 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp
@@ -56,8 +56,8 @@
EmbeddedBuf HashAdjBuffer;
};
-TpiStream::TpiStream(PDBFile &File)
- : Pdb(File), Stream(StreamTPI, File), HashFunction(nullptr) {}
+TpiStream::TpiStream(PDBFile &File, uint32_t StreamIdx)
+ : Pdb(File), Stream(StreamIdx, File), HashFunction(nullptr) {}
TpiStream::~TpiStream() {}