22 for (
const auto &Member : Doc.
Members) {
25 Image.TheImageKind = *Member.ImageKind;
26 if (Member.OffloadKind)
27 Image.TheOffloadKind = *Member.OffloadKind;
29 Image.Flags = *Member.Flags;
31 if (Member.StringEntries)
32 for (
const auto &Entry : *Member.StringEntries)
33 Image.StringData[Entry.Key] = Entry.Value;
38 Member.Content->writeAsBinary(OS);
50 TheHeader->Size = *Doc.
Size;
56 Out.
write(Buffer.begin(), Buffer.size());
This file declares classes for handling the YAML representation of offloading binaries.
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.
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.
raw_ostream & write(unsigned char C)
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.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
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.