class Block

Declaration

class Block : public Addressable { /* full declaration omitted */ };

Description

An Addressable with content and edges.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:150

Inherits from: Addressable

Member Variables

private llvm::jitlink::Section* Parent
private const char* Data = nullptr
private size_t Size = 0
private std::vector<Edge> Edges
private static const uint64_t MaxAlignmentOffset = (1ULL << 56) - 1

Inherited from Addressable:

protected ContentMutable
protected P2Align
protected AlignmentOffset

Method Overview

  • private Block(llvm::jitlink::Section & Parent, ArrayRef<char> Content, orc::ExecutorAddr Address, uint64_t Alignment, uint64_t AlignmentOffset)
  • private Block(llvm::jitlink::Section & Parent, MutableArrayRef<char> Content, orc::ExecutorAddr Address, uint64_t Alignment, uint64_t AlignmentOffset)
  • public Block(const llvm::jitlink::Block &)
  • public Block(llvm::jitlink::Block &&)
  • private Block(llvm::jitlink::Section & Parent, orc::ExecutorAddrDiff Size, orc::ExecutorAddr Address, uint64_t Alignment, uint64_t AlignmentOffset)
  • public void addEdge(const llvm::jitlink::Edge & E)
  • public void addEdge(Edge::Kind K, Edge::OffsetT Offset, llvm::jitlink::Symbol & Target, Edge::AddendT Addend)
  • public iterator_range<llvm::jitlink::Block::const_edge_iterator> edges() const
  • public iterator_range<llvm::jitlink::Block::edge_iterator> edges()
  • public bool edges_empty() const
  • public size_t edges_size() const
  • public uint64_t getAlignment() const
  • public uint64_t getAlignmentOffset() const
  • public MutableArrayRef<char> getAlreadyMutableContent()
  • public ArrayRef<char> getContent() const
  • public orc::ExecutorAddr getFixupAddress(const llvm::jitlink::Edge & E) const
  • public MutableArrayRef<char> getMutableContent(llvm::jitlink::LinkGraph & G)
  • public orc::ExecutorAddrRange getRange() const
  • public llvm::jitlink::Section & getSection() const
  • public size_t getSize() const
  • public bool isContentMutable() const
  • public bool isZeroFill() const
  • public llvm::jitlink::Block::edge_iterator removeEdge(llvm::jitlink::Block::edge_iterator I)
  • public void setAlignment(uint64_t Alignment)
  • public void setAlignmentOffset(uint64_t AlignmentOffset)
  • public void setContent(ArrayRef<char> Content)
  • public void setMutableContent(MutableArrayRef<char> MutableContent)
  • private void setSection(llvm::jitlink::Section & Parent)

Inherited from Addressable:

Methods

Block(llvm::jitlink::Section& Parent,
      ArrayRef<char> Content,
      orc::ExecutorAddr Address,
      uint64_t Alignment,
      uint64_t AlignmentOffset)

Description

Create a defined addressable for the given content. The Content is assumed to be non-writable, and will be copied when mutations are required.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:171

Parameters

llvm::jitlink::Section& Parent
ArrayRef<char> Content
orc::ExecutorAddr Address
uint64_t Alignment
uint64_t AlignmentOffset

Block(llvm::jitlink::Section& Parent,
      MutableArrayRef<char> Content,
      orc::ExecutorAddr Address,
      uint64_t Alignment,
      uint64_t AlignmentOffset)

Description

Create a defined addressable for the given content. The content is assumed to be writable, and the caller is responsible for ensuring that it lives for the duration of the Block's lifetime. The standard way to achieve this is to allocate it on the Graph's allocator.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:190

Parameters

llvm::jitlink::Section& Parent
MutableArrayRef<char> Content
orc::ExecutorAddr Address
uint64_t Alignment
uint64_t AlignmentOffset

Block(const llvm::jitlink::Block&)

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:209

Parameters

const llvm::jitlink::Block&

Block(llvm::jitlink::Block&&)

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:211

Parameters

llvm::jitlink::Block&&

Block(llvm::jitlink::Section& Parent,
      orc::ExecutorAddrDiff Size,
      orc::ExecutorAddr Address,
      uint64_t Alignment,
      uint64_t AlignmentOffset)

Description

Create a zero-fill defined addressable.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:155

Parameters

llvm::jitlink::Section& Parent
orc::ExecutorAddrDiff Size
orc::ExecutorAddr Address
uint64_t Alignment
uint64_t AlignmentOffset

void addEdge(const llvm::jitlink::Edge& E)

Description

Add an edge by copying an existing one. This is typically used when moving edges between blocks.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:312

Parameters

const llvm::jitlink::Edge& E

void addEdge(Edge::Kind K,
             Edge::OffsetT Offset,
             llvm::jitlink::Symbol& Target,
             Edge::AddendT Addend)

Description

Add an edge to this block.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:304

Parameters

Edge::Kind K
Edge::OffsetT Offset
llvm::jitlink::Symbol& Target
Edge::AddendT Addend

iterator_range<
    llvm::jitlink::Block::const_edge_iterator>
edges() const

Description

Returns the list of edges attached to this content.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:320

iterator_range<
    llvm::jitlink::Block::edge_iterator>
edges()

Description

Return the list of edges attached to this content.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:315

bool edges_empty() const

Description

Returns true if the list of edges is empty.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:328

size_t edges_size() const

Description

Return the size of the edges list.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:325

uint64_t getAlignment() const

Description

Get the alignment for this content.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:285

uint64_t getAlignmentOffset() const

Description

Get the alignment offset for this content.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:294

MutableArrayRef<char> getAlreadyMutableContent()

Description

Get mutable content for this block. This block's content must already be mutable. It is a programmatic error to call this on a block with immutable content -- consider using getMutableContent instead.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:259

ArrayRef<char> getContent() const

Description

Get the content for this block. Block must not be a zero-fill block.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:232

orc::ExecutorAddr getFixupAddress(
    const llvm::jitlink::Edge& E) const

Description

Returns the address of the fixup for the given edge, which is equal to this block's address plus the edge's offset.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:336

Parameters

const llvm::jitlink::Edge& E

MutableArrayRef<char> getMutableContent(
    llvm::jitlink::LinkGraph& G)

Description

Get mutable content for this block. If this Block's content is not already mutable this will trigger a copy of the existing immutable content to a new, mutable buffer allocated using LinkGraph::allocateContent.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:252

Parameters

llvm::jitlink::LinkGraph& G

orc::ExecutorAddrRange getRange() const

Description

Returns the address range of this defined addressable.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:227

llvm::jitlink::Section& getSection() const

Description

Return the parent section for this block.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:215

size_t getSize() const

Description

Returns the size of this defined addressable.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:224

bool isContentMutable() const

Description

Returns true if this block's content is mutable. This is primarily useful for asserting that a block is already in a mutable state prior to modifying the content. E.g. when applying fixups we expect the block to already be mutable as it should have been copied to working memory.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:282

bool isZeroFill() const

Description

Returns true if this is a zero-fill block. If true, getSize is callable but getContent is not (the content is defined to be a sequence of zero bytes of length Size).

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:221

llvm::jitlink::Block::edge_iterator removeEdge(
    llvm::jitlink::Block::edge_iterator I)

Description

Remove the edge pointed to by the given iterator. Returns an iterator to the new next element.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:332

Parameters

llvm::jitlink::Block::edge_iterator I

void setAlignment(uint64_t Alignment)

Description

Set the alignment for this content.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:288

Parameters

uint64_t Alignment

void setAlignmentOffset(uint64_t AlignmentOffset)

Description

Set the alignment offset for this content.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:297

Parameters

uint64_t AlignmentOffset

void setContent(ArrayRef<char> Content)

Description

Set the content for this block. Caller is responsible for ensuring the underlying bytes are not deallocated while pointed to by this block.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:240

Parameters

ArrayRef<char> Content

void setMutableContent(
    MutableArrayRef<char> MutableContent)

Description

Set mutable content for this block. The caller is responsible for ensuring that the memory pointed to by MutableContent is not deallocated while pointed to by this block.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:269

Parameters

MutableArrayRef<char> MutableContent

void setSection(llvm::jitlink::Section& Parent)

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:343

Parameters

llvm::jitlink::Section& Parent