diff options
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp index 2cc2a73a0d1..6b5cd212ed9 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp @@ -302,3 +302,15 @@ Error DbiStream::initializeFileInfo() { return Error::success(); } + +uint32_t DbiStream::getDebugStreamIndex(DbgHeaderType Type) const { + ArrayRef<uint8_t> DbgData; + if (auto EC = DbgHeader.getArrayRef(0, DbgData, DbgHeader.getLength())) { + consumeError(std::move(EC)); + return uint32_t(-1); + } + ArrayRef<ulittle16_t> DebugStreams( + reinterpret_cast<const ulittle16_t *>(DbgData.data()), + DbgData.size() / sizeof(ulittle16_t)); + return DebugStreams[static_cast<uint16_t>(Type)]; +} |