[msf] Make FPM reader use MappedBlockStream.
MappedBlockSTream can work with any sequence of block data where
the ordering is specified by a list of block numbers. So rather
than manually stitch them together in the case of the FPM, reuse
this functionality so that we can treat the FPM as if it were
contiguous.
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D23066
llvm-svn: 277609
diff --git a/llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp b/llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp
index 3018a70..b4e5ea7 100644
--- a/llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp
+++ b/llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp
@@ -291,9 +291,8 @@
recordKnownUsedPage(PS, 0); // MSF Super Block
- uint32_t BlocksPerSection = File.getBlockSize();
- uint32_t NumSections =
- llvm::alignTo(File.getBlockCount(), BlocksPerSection) / BlocksPerSection;
+ uint32_t BlocksPerSection = msf::getFpmIntervalLength(File.getMsfLayout());
+ uint32_t NumSections = msf::getNumFpmIntervals(File.getMsfLayout());
for (uint32_t I = 0; I < NumSections; ++I) {
uint32_t Fpm0 = 1 + BlocksPerSection * I;
// 2 Fpm blocks spaced at `getBlockSize()` block intervals