Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp
Show All 11 Lines | |||||
#include "llvm/DebugInfo/PDB/Native/PDBFile.h" | #include "llvm/DebugInfo/PDB/Native/PDBFile.h" | ||||
#include "llvm/DebugInfo/PDB/Native/PDBStringTable.h" | #include "llvm/DebugInfo/PDB/Native/PDBStringTable.h" | ||||
namespace llvm { | namespace llvm { | ||||
namespace pdb { | namespace pdb { | ||||
namespace { | namespace { | ||||
Expected<std::string> readStreamData(BinaryStream &Stream, uint32_t Limit) { | Expected<std::string> readStreamData(BinaryStream &Stream, uint64_t Limit) { | ||||
uint32_t Offset = 0, DataLength = std::min(Limit, Stream.getLength()); | uint64_t Offset = 0, DataLength = std::min(Limit, Stream.getLength()); | ||||
std::string Result; | std::string Result; | ||||
Result.reserve(DataLength); | Result.reserve(DataLength); | ||||
while (Offset < DataLength) { | while (Offset < DataLength) { | ||||
ArrayRef<uint8_t> Data; | ArrayRef<uint8_t> Data; | ||||
if (auto E = Stream.readLongestContiguousChunk(Offset, Data)) | if (auto E = Stream.readLongestContiguousChunk(Offset, Data)) | ||||
return std::move(E); | return std::move(E); | ||||
Data = Data.take_front(DataLength - Offset); | Data = Data.take_front(DataLength - Offset); | ||||
Offset += Data.size(); | Offset += Data.size(); | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |