summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp')
-rw-r--r--llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp b/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp
index e45f4ae0ed9..2a200edeaf7 100644
--- a/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp
+++ b/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp
@@ -11,7 +11,6 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/DebugInfo/MSF/MSFCommon.h"
-#include "llvm/DebugInfo/MSF/MSFStreamLayout.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MathExtras.h"
@@ -36,19 +35,6 @@ public:
} // end anonymous namespace
-static void initializeFpmStreamLayout(const MSFLayout &Layout,
- MSFStreamLayout &FpmLayout) {
- uint32_t NumFpmIntervals = msf::getNumFpmIntervals(Layout);
- support::ulittle32_t FpmBlock = Layout.SB->FreeBlockMapBlock;
- assert(FpmBlock == 1 || FpmBlock == 2);
- while (NumFpmIntervals > 0) {
- FpmLayout.Blocks.push_back(FpmBlock);
- FpmBlock += msf::getFpmIntervalLength(Layout);
- --NumFpmIntervals;
- }
- FpmLayout.Length = msf::getFullFpmByteSize(Layout);
-}
-
using Interval = std::pair<uint32_t, uint32_t>;
static Interval intersect(const Interval &I1, const Interval &I2) {
@@ -95,8 +81,7 @@ std::unique_ptr<MappedBlockStream>
MappedBlockStream::createFpmStream(const MSFLayout &Layout,
BinaryStreamRef MsfData,
BumpPtrAllocator &Allocator) {
- MSFStreamLayout SL;
- initializeFpmStreamLayout(Layout, SL);
+ MSFStreamLayout SL(getFpmStreamLayout(Layout));
return createStream(Layout.SB->BlockSize, SL, MsfData, Allocator);
}
@@ -363,8 +348,7 @@ std::unique_ptr<WritableMappedBlockStream>
WritableMappedBlockStream::createFpmStream(const MSFLayout &Layout,
WritableBinaryStreamRef MsfData,
BumpPtrAllocator &Allocator) {
- MSFStreamLayout SL;
- initializeFpmStreamLayout(Layout, SL);
+ MSFStreamLayout SL(getFpmStreamLayout(Layout));
return createStream(Layout.SB->BlockSize, SL, MsfData, Allocator);
}
OpenPOWER on IntegriCloud