LLVM 22.0.0git
|
An Addressable with content and edges. More...
#include "llvm/ExecutionEngine/JITLink/JITLink.h"
Public Types | |
using | EdgeVector = std::vector<Edge> |
using | edge_iterator = EdgeVector::iterator |
using | const_edge_iterator = EdgeVector::const_iterator |
Public Member Functions | |
Block (const Block &)=delete | |
Block & | operator= (const Block &)=delete |
Block (Block &&)=delete | |
Block & | operator= (Block &&)=delete |
Section & | getSection () const |
Return the parent section for this block. | |
bool | isZeroFill () const |
Returns true if this is a zero-fill block. | |
size_t | getSize () const |
Returns the size of this defined addressable. | |
void | setZeroFillSize (size_t Size) |
Turns this block into a zero-fill block of the given size. | |
orc::ExecutorAddrRange | getRange () const |
Returns the address range of this defined addressable. | |
ArrayRef< char > | getContent () const |
Get the content for this block. Block must not be a zero-fill block. | |
void | setContent (ArrayRef< char > Content) |
Set the content for this block. | |
MutableArrayRef< char > | getMutableContent (LinkGraph &G) |
Get mutable content for this block. | |
MutableArrayRef< char > | getAlreadyMutableContent () |
Get mutable content for this block. | |
void | setMutableContent (MutableArrayRef< char > MutableContent) |
Set mutable content for this block. | |
bool | isContentMutable () const |
Returns true if this block's content is mutable. | |
uint64_t | getAlignment () const |
Get the alignment for this content. | |
void | setAlignment (uint64_t Alignment) |
Set the alignment for this content. | |
uint64_t | getAlignmentOffset () const |
Get the alignment offset for this content. | |
void | setAlignmentOffset (uint64_t AlignmentOffset) |
Set the alignment offset for this content. | |
void | addEdge (Edge::Kind K, Edge::OffsetT Offset, Symbol &Target, Edge::AddendT Addend) |
Add an edge to this block. | |
void | addEdge (const Edge &E) |
Add an edge by copying an existing one. | |
iterator_range< edge_iterator > | edges () |
Return the list of edges attached to this content. | |
iterator_range< const_edge_iterator > | edges () const |
Returns the list of edges attached to this content. | |
auto | edges_at (Edge::OffsetT O) |
Returns an iterator over all edges at the given offset within the block. | |
auto | edges_at (Edge::OffsetT O) const |
Returns an iterator over all edges at the given offset within the block. | |
size_t | edges_size () const |
Return the size of the edges list. | |
bool | edges_empty () const |
Returns true if the list of edges is empty. | |
edge_iterator | removeEdge (edge_iterator I) |
Remove the edge pointed to by the given iterator. | |
orc::ExecutorAddr | getFixupAddress (const Edge &E) const |
Returns the address of the fixup for the given edge, which is equal to this block's address plus the edge's offset. | |
Public Member Functions inherited from llvm::jitlink::Addressable | |
Addressable (const Addressable &)=delete | |
Addressable & | operator= (const Addressable &)=default |
Addressable (Addressable &&)=delete | |
Addressable & | operator= (Addressable &&)=default |
orc::ExecutorAddr | getAddress () const |
void | setAddress (orc::ExecutorAddr Address) |
bool | isDefined () const |
Returns true if this is a defined addressable, in which case you can downcast this to a Block. | |
bool | isAbsolute () const |
Friends | |
class | LinkGraph |
Additional Inherited Members | |
Protected Member Functions inherited from llvm::jitlink::Addressable | |
Addressable (orc::ExecutorAddr Address, bool IsDefined) | |
Addressable (orc::ExecutorAddr Address) | |
Protected Attributes inherited from llvm::jitlink::Addressable | |
uint64_t | ContentMutable: 1 |
uint64_t | P2Align: 5 |
uint64_t | AlignmentOffset: 56 |
An Addressable with content and edges.
using llvm::jitlink::Block::const_edge_iterator = EdgeVector::const_iterator |
using llvm::jitlink::Block::edge_iterator = EdgeVector::iterator |
using llvm::jitlink::Block::EdgeVector = std::vector<Edge> |
|
delete |
|
inline |
Add an edge to this block.
Definition at line 319 of file JITLink.h.
References assert(), isZeroFill(), and llvm::Offset.
Referenced by llvm::jitlink::loongarch::createAnonymousPointerJumpStub().
|
inline |
Return the list of edges attached to this content.
Definition at line 331 of file JITLink.h.
References llvm::make_range().
Referenced by edges_at(), edges_at(), and llvm::jitlink::finalizeBlockRelax().
|
inline |
Returns the list of edges attached to this content.
Definition at line 336 of file JITLink.h.
References llvm::make_range().
|
inline |
Returns an iterator over all edges at the given offset within the block.
Definition at line 341 of file JITLink.h.
References E(), edges(), and llvm::make_filter_range().
|
inline |
Returns an iterator over all edges at the given offset within the block.
Definition at line 347 of file JITLink.h.
References E(), edges(), and llvm::make_filter_range().
|
inline |
|
inline |
|
inline |
Get the alignment for this content.
Definition at line 300 of file JITLink.h.
References llvm::jitlink::Addressable::P2Align.
|
inline |
Get the alignment offset for this content.
Definition at line 309 of file JITLink.h.
References llvm::jitlink::Addressable::AlignmentOffset.
|
inline |
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.
Definition at line 274 of file JITLink.h.
References assert(), and llvm::jitlink::Addressable::ContentMutable.
Referenced by llvm::jitlink::finalizeBlockRelax().
Get the content for this block. Block must not be a zero-fill block.
Definition at line 247 of file JITLink.h.
References assert().
Referenced by llvm::jitlink::Symbol::getSymbolContent().
|
inline |
Returns the address of the fixup for the given edge, which is equal to this block's address plus the edge's offset.
Definition at line 364 of file JITLink.h.
References E(), and llvm::jitlink::Addressable::getAddress().
|
inline |
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.
Definition at line 1684 of file JITLink.h.
References llvm::jitlink::Addressable::ContentMutable, G, LinkGraph, and setMutableContent().
|
inline |
Returns the address range of this defined addressable.
Definition at line 242 of file JITLink.h.
References llvm::jitlink::Addressable::getAddress(), and getSize().
|
inline |
Return the parent section for this block.
Definition at line 224 of file JITLink.h.
Referenced by llvm::jitlink::LinkGraph::addAnonymousSymbol(), llvm::jitlink::LinkGraph::addDefinedSymbol(), llvm::jitlink::Symbol::getSection(), llvm::jitlink::LinkGraph::makeDefined(), and llvm::jitlink::LinkGraph::transferDefinedSymbol().
|
inline |
Returns the size of this defined addressable.
Definition at line 233 of file JITLink.h.
Referenced by getRange(), llvm::jitlink::Symbol::setSize(), and llvm::jitlink::LinkGraph::transferDefinedSymbol().
|
inline |
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.
Definition at line 297 of file JITLink.h.
References llvm::jitlink::Addressable::ContentMutable.
|
inline |
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).
Definition at line 230 of file JITLink.h.
Referenced by addEdge(), and llvm::jitlink::Symbol::isSymbolZeroFill().
|
inline |
Remove the edge pointed to by the given iterator.
Returns an iterator to the new next element.
Definition at line 360 of file JITLink.h.
References I.
Referenced by llvm::jitlink::finalizeBlockRelax().
|
inline |
Set the alignment for this content.
Definition at line 303 of file JITLink.h.
References assert(), llvm::countr_zero(), llvm::isPowerOf2_64(), and llvm::jitlink::Addressable::P2Align.
|
inline |
Set the alignment offset for this content.
Definition at line 312 of file JITLink.h.
References llvm::jitlink::Addressable::AlignmentOffset, assert(), and llvm::jitlink::Addressable::P2Align.
Set the content for this block.
Caller is responsible for ensuring the underlying bytes are not deallocated while pointed to by this block.
Definition at line 255 of file JITLink.h.
References assert(), llvm::jitlink::Addressable::ContentMutable, llvm::ArrayRef< T >::data(), and llvm::ArrayRef< T >::size().
|
inline |
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.
Definition at line 284 of file JITLink.h.
References assert(), llvm::jitlink::Addressable::ContentMutable, llvm::MutableArrayRef< T >::data(), and llvm::ArrayRef< T >::size().
Referenced by getMutableContent().
|
inline |
|
friend |
Definition at line 160 of file JITLink.h.
References llvm::jitlink::Addressable::Addressable(), llvm::jitlink::Addressable::AlignmentOffset, llvm::jitlink::Addressable::ContentMutable, LinkGraph, and llvm::jitlink::Addressable::P2Align.
Referenced by getMutableContent(), and LinkGraph.