LLVM 20.0.0git
Classes | Namespaces | Typedefs | Enumerations | Functions
JITLink.h File Reference
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/FunctionExtras.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"
#include "llvm/ExecutionEngine/JITSymbol.h"
#include "llvm/ExecutionEngine/Orc/Core.h"
#include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
#include "llvm/ExecutionEngine/Orc/Shared/ExecutorSymbolDef.h"
#include "llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/BinaryStreamReader.h"
#include "llvm/Support/BinaryStreamWriter.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/TargetParser/SubtargetFeature.h"
#include "llvm/TargetParser/Triple.h"
#include <optional>
#include <map>
#include <string>
#include <system_error>

Go to the source code of this file.

Classes

class  llvm::jitlink::JITLinkError
 Base class for errors originating in JIT linker, e.g. More...
 
class  llvm::jitlink::Edge
 Represents fixups and constraints in the LinkGraph. More...
 
class  llvm::jitlink::Addressable
 Base class for Addressable entities (externals, absolutes, blocks). More...
 
class  llvm::jitlink::Block
 An Addressable with content and edges. More...
 
class  llvm::jitlink::Symbol
 Symbol representation. More...
 
class  llvm::jitlink::Section
 Represents an object file section. More...
 
class  llvm::jitlink::SectionRange
 Represents a section address range via a pair of Block pointers to the first and last Blocks in the section. More...
 
class  llvm::jitlink::LinkGraph
 
class  llvm::jitlink::LinkGraph::nested_collection_iterator< OuterItrT, InnerItrT, T, getInnerRange >
 
class  llvm::jitlink::BlockAddressMap
 Enables easy lookup of blocks by addresses. More...
 
class  llvm::jitlink::SymbolAddressMap
 A map of addresses to Symbols. More...
 
struct  llvm::jitlink::PassConfiguration
 An LinkGraph pass configuration, consisting of a list of pre-prune, post-prune, and post-fixup passes. More...
 
class  llvm::jitlink::JITLinkAsyncLookupContinuation
 A function object to call with a resolved symbol map (See AsyncLookupResult) or an error if resolution failed. More...
 
class  llvm::jitlink::JITLinkContext
 Holds context for a single jitLink invocation. More...
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
 

Typedefs

using llvm::jitlink::SectionOrdinal = unsigned
 
using llvm::jitlink::TargetFlagsType = uint8_t
 Holds target-specific properties for a symbol.
 
using llvm::jitlink::LinkGraphPassFunction = unique_function< Error(LinkGraph &)>
 A function for mutating LinkGraphs.
 
using llvm::jitlink::LinkGraphPassList = std::vector< LinkGraphPassFunction >
 A list of LinkGraph passes.
 
using llvm::jitlink::AsyncLookupResult = DenseMap< StringRef, orc::ExecutorSymbolDef >
 A map of symbol names to resolved addresses.
 
using llvm::jitlink::AnonymousPointerCreator = unique_function< Expected< Symbol & >(LinkGraph &G, Section &PointerSection, Symbol *InitialTarget, uint64_t InitialAddend)>
 Creates a new pointer block in the given section and returns an Anonymous symbol pointing to it.
 
using llvm::jitlink::PointerJumpStubCreator = unique_function< Expected< Symbol & >(LinkGraph &G, Section &StubSection, Symbol &PointerSymbol)>
 Create a jump stub that jumps via the pointer at the given symbol and an anonymous symbol pointing to it.
 

Enumerations

enum class  llvm::jitlink::Linkage : uint8_t { llvm::jitlink::Strong , llvm::jitlink::Weak }
 Describes symbol linkage. This can be used to resolve definition clashes. More...
 
enum class  llvm::jitlink::Scope : uint8_t { llvm::jitlink::Default , llvm::jitlink::Hidden , llvm::jitlink::Local }
 Defines the scope in which this symbol should be visible: Default – Visible in the public interface of the linkage unit. More...
 
enum class  llvm::jitlink::SymbolLookupFlags { llvm::jitlink::RequiredSymbol , llvm::jitlink::WeaklyReferencedSymbol }
 Flags for symbol lookup. More...
 

Functions

const charllvm::jitlink::getGenericEdgeKindName (Edge::Kind K)
 Returns the string name of the given generic edge kind, or "unknown" otherwise.
 
uint64_t llvm::jitlink::alignToBlock (uint64_t Addr, const Block &B)
 
orc::ExecutorAddr llvm::jitlink::alignToBlock (orc::ExecutorAddr Addr, const Block &B)
 
bool llvm::jitlink::isCStringBlock (Block &B)
 
const charllvm::jitlink::getLinkageName (Linkage L)
 For errors and debugging output.
 
const charllvm::jitlink::getScopeName (Scope S)
 For debugging output.
 
raw_ostreamllvm::jitlink::operator<< (raw_ostream &OS, const Block &B)
 
raw_ostreamllvm::jitlink::operator<< (raw_ostream &OS, const Symbol &A)
 
void llvm::jitlink::printEdge (raw_ostream &OS, const Block &B, const Edge &E, StringRef EdgeKindName)
 
raw_ostreamllvm::jitlink::operator<< (raw_ostream &OS, const SymbolLookupFlags &LF)
 
template<typename Continuation >
std::unique_ptr< JITLinkAsyncLookupContinuation > llvm::jitlink::createLookupContinuation (Continuation Cont)
 Create a lookup continuation from a function object.
 
Error llvm::jitlink::markAllSymbolsLive (LinkGraph &G)
 Marks all symbols in a graph live.
 
Error llvm::jitlink::makeTargetOutOfRangeError (const LinkGraph &G, const Block &B, const Edge &E)
 Create an out of range error for the given edge in the given block.
 
Error llvm::jitlink::makeAlignmentError (llvm::orc::ExecutorAddr Loc, uint64_t Value, int N, const Edge &E)
 
AnonymousPointerCreator llvm::jitlink::getAnonymousPointerCreator (const Triple &TT)
 Get target-specific AnonymousPointerCreator.
 
PointerJumpStubCreator llvm::jitlink::getPointerJumpStubCreator (const Triple &TT)
 Get target-specific PointerJumpStubCreator.
 
void llvm::jitlink::visitEdge (LinkGraph &G, Block *B, Edge &E)
 Base case for edge-visitors where the visitor-list is empty.
 
template<typename VisitorT , typename... VisitorTs>
void llvm::jitlink::visitEdge (LinkGraph &G, Block *B, Edge &E, VisitorT &&V, VisitorTs &&...Vs)
 Applies the first visitor in the list to the given edge.
 
template<typename... VisitorTs>
void llvm::jitlink::visitExistingEdges (LinkGraph &G, VisitorTs &&...Vs)
 For each edge in the given graph, apply a list of visitors to the edge, stopping when the first visitor's visitEdge method returns true.
 
Expected< std::unique_ptr< LinkGraph > > llvm::jitlink::createLinkGraphFromObject (MemoryBufferRef ObjectBuffer)
 Create a LinkGraph from the given object buffer.
 
std::unique_ptr< LinkGraph > llvm::jitlink::absoluteSymbolsLinkGraph (const Triple &TT, orc::SymbolMap Symbols)
 Create a LinkGraph defining the given absolute symbols.
 
void llvm::jitlink::link (std::unique_ptr< LinkGraph > G, std::unique_ptr< JITLinkContext > Ctx)
 Link the given graph.