class OffloadBinary

Declaration

class OffloadBinary : public Binary { /* full declaration omitted */ };

Description

A simple binary serialization of an offloading file. We use this format to embed the offloading image into the host executable so it can be extracted and used by the linker. Many of these could be stored in the same section by the time the linker sees it so we mark this information with a header. The version is used to detect ABI stability and the size is used to find other offloading entries that may exist in the same section. All offsets are given as absolute byte offsets from the beginning of the file.

Declared at: llvm/include/llvm/Object/OffloadBinary.h:60

Inherits from: Binary

Member Variables

private StringMap<llvm::StringRef> StringData
Map from keys to offsets in the binary.
private const char* Buffer
Raw pointer to the MemoryBufferRef for convenience.
private const llvm::object::OffloadBinary::Header* TheHeader
Location of the header within the binary.
private const llvm::object::OffloadBinary::Entry* TheEntry
Location of the metadata entries within the binary.
public static const uint32_t Version = 1
The current version of the binary used for backwards compatibility.

Inherited from Binary:

protected Data

Method Overview

  • private OffloadBinary(llvm::MemoryBufferRef Source, const llvm::object::OffloadBinary::Header * TheHeader, const llvm::object::OffloadBinary::Entry * TheEntry)
  • private OffloadBinary(const llvm::object::OffloadBinary & Other)
  • public static bool classof(const llvm::object::Binary * V)
  • public static Expected<std::unique_ptr<OffloadBinary>> create(llvm::MemoryBufferRef)
  • public static uint64_t getAlignment()
  • public llvm::StringRef getArch() const
  • public uint32_t getFlags() const
  • public llvm::StringRef getImage() const
  • public llvm::object::ImageKind getImageKind() const
  • public llvm::object::OffloadKind getOffloadKind() const
  • public uint64_t getSize() const
  • public llvm::StringRef getString(llvm::StringRef Key) const
  • public llvm::StringRef getTriple() const
  • public uint32_t getVersion() const
  • public llvm::object::OffloadBinary::string_iterator_range strings() const
  • public static std::unique_ptr<MemoryBuffer> write(const llvm::object::OffloadBinary::OffloadingImage &)

Inherited from Binary:

Methods

OffloadBinary(
    llvm::MemoryBufferRef Source,
    const llvm::object::OffloadBinary::Header*
        TheHeader,
    const llvm::object::OffloadBinary::Entry*
        TheEntry)

Declared at: llvm/include/llvm/Object/OffloadBinary.h:130

Parameters

llvm::MemoryBufferRef Source
const llvm::object::OffloadBinary::Header* TheHeader
const llvm::object::OffloadBinary::Entry* TheEntry

OffloadBinary(
    const llvm::object::OffloadBinary& Other)

Declared at: llvm/include/llvm/Object/OffloadBinary.h:142

Parameters

const llvm::object::OffloadBinary& Other

static bool classof(const llvm::object::Binary* V)

Declared at: llvm/include/llvm/Object/OffloadBinary.h:104

Parameters

const llvm::object::Binary* V

static Expected<std::unique_ptr<OffloadBinary>>
create(llvm::MemoryBufferRef)

Description

Attempt to parse the offloading binary stored in \p Data.

Declared at: llvm/include/llvm/Object/OffloadBinary.h:78

Parameters

llvm::MemoryBufferRef

static uint64_t getAlignment()

Declared at: llvm/include/llvm/Object/OffloadBinary.h:83

llvm::StringRef getArch() const

Declared at: llvm/include/llvm/Object/OffloadBinary.h:92

uint32_t getFlags() const

Declared at: llvm/include/llvm/Object/OffloadBinary.h:88

llvm::StringRef getImage() const

Declared at: llvm/include/llvm/Object/OffloadBinary.h:93

llvm::object::ImageKind getImageKind() const

Declared at: llvm/include/llvm/Object/OffloadBinary.h:85

llvm::object::OffloadKind getOffloadKind() const

Declared at: llvm/include/llvm/Object/OffloadBinary.h:86

uint64_t getSize() const

Declared at: llvm/include/llvm/Object/OffloadBinary.h:89

llvm::StringRef getString(
    llvm::StringRef Key) const

Declared at: llvm/include/llvm/Object/OffloadBinary.h:102

Parameters

llvm::StringRef Key

llvm::StringRef getTriple() const

Declared at: llvm/include/llvm/Object/OffloadBinary.h:91

uint32_t getVersion() const

Declared at: llvm/include/llvm/Object/OffloadBinary.h:87

llvm::object::OffloadBinary::string_iterator_range
strings() const

Declared at: llvm/include/llvm/Object/OffloadBinary.h:98

static std::unique_ptr<MemoryBuffer> write(
    const llvm::object::OffloadBinary::
        OffloadingImage&)

Description

Serialize the contents of \p File to a binary buffer to be read later.

Declared at: llvm/include/llvm/Object/OffloadBinary.h:81

Parameters

const llvm::object::OffloadBinary:: OffloadingImage&