Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp
Show First 20 Lines • Show All 360 Lines • ▼ Show 20 Lines | WritableMappedBlockStream::createFpmStream(const MSFLayout &Layout, | ||||
MSFStreamLayout FullLayout(getFpmStreamLayout(Layout, true, AltFpm)); | MSFStreamLayout FullLayout(getFpmStreamLayout(Layout, true, AltFpm)); | ||||
auto Result = | auto Result = | ||||
createStream(Layout.SB->BlockSize, FullLayout, MsfData, Allocator); | createStream(Layout.SB->BlockSize, FullLayout, MsfData, Allocator); | ||||
if (!Result) | if (!Result) | ||||
return Result; | return Result; | ||||
std::vector<uint8_t> InitData(Layout.SB->BlockSize, 0xFF); | std::vector<uint8_t> InitData(Layout.SB->BlockSize, 0xFF); | ||||
BinaryStreamWriter Initializer(*Result); | BinaryStreamWriter Initializer(*Result); | ||||
while (Initializer.bytesRemaining() > 0) | while (Initializer.bytesRemaining() > 0) | ||||
cantFail(Initializer.writeBytes(InitData)); | llvm_cantFail(Initializer.writeBytes(InitData)); | ||||
return createStream(Layout.SB->BlockSize, MinLayout, MsfData, Allocator); | return createStream(Layout.SB->BlockSize, MinLayout, MsfData, Allocator); | ||||
} | } | ||||
Error WritableMappedBlockStream::readBytes(uint32_t Offset, uint32_t Size, | Error WritableMappedBlockStream::readBytes(uint32_t Offset, uint32_t Size, | ||||
ArrayRef<uint8_t> &Buffer) { | ArrayRef<uint8_t> &Buffer) { | ||||
return ReadInterface.readBytes(Offset, Size, Buffer); | return ReadInterface.readBytes(Offset, Size, Buffer); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |