24 for (
const auto &Member : Doc.
Members) {
27 Image.TheImageKind = *Member.ImageKind;
28 if (Member.OffloadKind)
29 Image.TheOffloadKind = *Member.OffloadKind;
31 Image.Flags = *Member.Flags;
33 if (Member.StringEntries)
34 for (
const auto &Entry : *Member.StringEntries)
35 Image.StringData[Entry.Key] = Entry.Value;
40 Member.Content->writeAsBinary(OS);
50 if (!CompressedOrErr) {
54 Buffer = std::move(*CompressedOrErr);
63 TheHeader->Size = *Doc.
Size;
This file declares classes for handling the YAML representation of offloading binaries.
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
static std::unique_ptr< MemoryBuffer > getMemBufferCopy(StringRef InputData, const Twine &BufferName="")
Open the specified memory range as a MemoryBuffer, copying the contents and taking ownership of it.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
static LLVM_ABI SmallString< 0 > write(ArrayRef< OffloadingImage > OffloadingData)
Serialize the contents of OffloadingData to a binary buffer to be read later.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an SmallVector or SmallString.
StringRef str() const
Return a StringRef for the vector contents.
llvm::function_ref< void(const Twine &Msg)> ErrorHandler
LLVM_ABI bool yaml2offload(OffloadYAML::Binary &Doc, raw_ostream &Out, ErrorHandler EH)
This is an optimization pass for GlobalISel generic memory operations.
std::string toString(const APInt &I, unsigned Radix, bool Signed, bool formatAsCLiteral=false, bool UpperCase=true, bool InsertSeparators=false)
std::optional< compression::Format > Compression
std::optional< uint64_t > EntriesOffset
std::optional< uint32_t > Version
std::optional< uint64_t > Size
std::vector< Member > Members
std::optional< uint64_t > EntriesCount
The offloading metadata that will be serialized to a memory buffer.
Common declarations for yaml2obj.