29 auto PreReadOffset = OffsetPtr;
31 if (OffsetPtr == PreReadOffset)
34 "Failed reading version from file header at offset %d.", OffsetPtr);
36 PreReadOffset = OffsetPtr;
37 FileHeader.
Type = HeaderExtractor.
getU16(&OffsetPtr);
38 if (OffsetPtr == PreReadOffset)
41 "Failed reading file type from file header at offset %d.", OffsetPtr);
43 PreReadOffset = OffsetPtr;
45 if (OffsetPtr == PreReadOffset)
48 "Failed reading flag bits from file header at offset %d.", OffsetPtr);
52 PreReadOffset = OffsetPtr;
54 if (OffsetPtr == PreReadOffset)
57 "Failed reading cycle frequency from file header at offset %d.",
66 return std::move(FileHeader);
This class represents lattice values for constants.
Expected< XRayFileHeader > readBinaryFormatHeader(DataExtractor &HeaderExtractor, uint32_t &OffsetPtr)
Convenience function for loading the file header given a data extractor at a specified offset...
std::error_code make_error_code(BitcodeError E)
Tagged union holding either a T or a Error.
const unsigned char * bytes_begin() const
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.