Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions llvm/include/llvm/Object/OffloadBinary.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class OffloadBinary : public Binary {
using string_iterator_range = iterator_range<string_iterator>;

/// The current version of the binary used for backwards compatibility.
static const uint32_t Version = 1;
static const uint32_t Version = 2;

/// The offloading metadata that will be serialized to a memory buffer.
struct OffloadingImage {
Expand Down Expand Up @@ -109,9 +109,12 @@ class OffloadBinary : public Binary {
struct Header {
uint8_t Magic[4] = {0x10, 0xFF, 0x10, 0xAD}; // 0x10FF10AD magic bytes.
uint32_t Version = OffloadBinary::Version; // Version identifier.
uint64_t Size; // Size in bytes of this entire binary.
uint64_t EntryOffset; // Offset of the metadata entry in bytes.
uint64_t EntrySize; // Size of the metadata entry in bytes.
uint64_t Size; // Size in bytes of this entire binary.
uint64_t EntriesCount; // Number of metadata entries in the binary.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with changing this, it wasn't really used for anything but a sanity check during parsing

uint64_t EntriesOffset; // Offset in bytes to the start of entries block.
uint64_t EntriesSize; // Size of the entries block in bytes.
uint64_t StringOffset; // Offset in bytes to the global string map
uint64_t NumStrings; // Number of entries in the global string map.
};

struct Entry {
Expand All @@ -127,6 +130,7 @@ class OffloadBinary : public Binary {
struct StringEntry {
uint64_t KeyOffset;
uint64_t ValueOffset;
uint64_t ValueSize; // Size of the value in bytes.
};

private:
Expand Down
Loading