LLVM  14.0.0git
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
llvm::orc Namespace Reference

Namespaces

 detail
 
 orcrpctpc
 
 remote
 
 rt
 
 rt_bootstrap
 
 shared
 
 SimpleRemoteEPCDefaultBootstrapSymbolNames
 
 tpctypes
 

Classes

class  AbsoluteSymbolsMaterializationUnit
 A MaterializationUnit implementation for pre-existing absolute symbols. More...
 
class  AsynchronousSymbolQuery
 A symbol query that returns results via a callback when results are ready. More...
 
class  BasicIRLayerMaterializationUnit
 MaterializationUnit that materializes modules by calling the 'emit' method on the given IRLayer. More...
 
class  BasicObjectLayerMaterializationUnit
 Materializes the given object file (represented by a MemoryBuffer instance) by calling 'emit' on the given ObjectLayer. More...
 
class  BlockFreqQuery
 
class  CompileOnDemandLayer
 
class  ConcurrentIRCompiler
 A thread-safe version of SimpleCompiler. More...
 
class  CtorDtorIterator
 This iterator provides a convenient way to iterate over the elements of an llvm.global_ctors/llvm.global_dtors instance. More...
 
class  CtorDtorRunner
 
class  DebugObject
 The plugin creates a debug object from JITLinkContext when JITLink starts processing the corresponding LinkGraph. More...
 
class  DebugObjectManagerPlugin
 Creates and manages DebugObjects for JITLink artifacts. More...
 
class  DebugObjectRegistrar
 Abstract interface for registering debug objects in the executor process. More...
 
class  DebugObjectSection
 
class  DefinitionGenerator
 Definition generators can be attached to JITDylibs to generate new definitions for otherwise unresolved symbols during lookup. More...
 
class  DumpObjects
 A function object that can be used as an ObjectTransformLayer transform to dump object files to disk at a specified path. More...
 
class  DuplicateDefinition
 
class  DynamicLibrarySearchGenerator
 A utility class to expose symbols found via dlsym to the JIT. More...
 
class  EHFrameRegistrationPlugin
 
class  ELFDebugObject
 The current implementation of ELFDebugObject replicates the approach used in RuntimeDyld: It patches executable and data section headers in the given object buffer with load-addresses of their corresponding sections in target memory. More...
 
class  ELFDebugObjectSection
 
class  ELFNixJITDylibDeinitializers
 
struct  ELFNixJITDylibInitializers
 
class  ELFNixPlatform
 Mediates between ELFNix initialization and ExecutionSession state. More...
 
struct  ELFPerObjectSectionsToRegister
 
class  EPCDebugObjectRegistrar
 Use ExecutorProcessControl to register debug objects locally or in a remote executor process. More...
 
class  EPCDynamicLibrarySearchGenerator
 
class  EPCEHFrameRegistrar
 Register/Deregisters EH frames in a remote process via a ExecutorProcessControl instance. More...
 
class  EPCGenericDylibManager
 
class  EPCGenericJITLinkMemoryManager
 
class  EPCGenericMemoryAccess
 
class  EPCIndirectionUtils
 Provides ExecutorProcessControl based indirect stubs, trampoline pool and lazy call through manager. More...
 
class  EPCIndirectionUtilsAccess
 
class  ExecutionSession
 An ExecutionSession represents a running JIT program. More...
 
class  ExecutorAddr
 Represents an address in the executor process. More...
 
class  ExecutorAddrDiff
 Represents the difference between two addresses in the executor process. More...
 
struct  ExecutorAddrRange
 Represents an address range in the exceutor process. More...
 
class  ExecutorBootstrapService
 
class  ExecutorProcessControl
 ExecutorProcessControl supports interaction with a JIT target process. More...
 
class  FailedToMaterialize
 Used to notify a JITDylib that the given set of symbols failed to materialize. More...
 
class  FDSimpleRemoteEPCTransport
 Uses read/write on FileDescriptors for transport. More...
 
class  ImplSymbolMap
 
struct  IndirectStubsAllocationSizes
 
class  IndirectStubsManager
 Base class for managing collections of named indirect stubs. More...
 
class  InProgressFullLookupState
 
class  InProgressLookupFlagsState
 
class  InProgressLookupState
 
class  IRCompileLayer
 
class  IRLayer
 Interface for layers that accept LLVM IR. More...
 
class  IRMaterializationUnit
 IRMaterializationUnit is a convenient base class for MaterializationUnits wrapping LLVM IR. More...
 
class  IRSpeculationLayer
 
class  IRSymbolMapper
 Maps IR global values to their linker symbol names / flags. More...
 
class  IRTransformLayer
 A layer that applies a transform to emitted modules. More...
 
class  ItaniumCXAAtExitSupport
 An interface for Itanium __cxa_atexit interposer implementations. More...
 
class  JITCompileCallbackManager
 Target-independent base class for compile callback management. More...
 
class  JITDylib
 A symbol table that supports asynchoronous symbol queries. More...
 
class  JITSymbolNotFound
 
class  JITTargetMachineBuilder
 A utility class for building TargetMachines for JITs. More...
 
class  JITTargetMachineBuilderPrinter
 
class  LazyCallThroughManager
 Manages a set of 'lazy call-through' trampolines. More...
 
class  LazyReexportsMaterializationUnit
 A materialization unit that builds lazy re-exports. More...
 
class  LLJIT
 A pre-fabricated ORC JIT stack that can serve as an alternative to MCJIT. More...
 
class  LLJITBuilder
 Constructs LLJIT instances. More...
 
class  LLJITBuilderSetters
 
class  LLJITBuilderState
 
class  LLLazyJIT
 An extended version of LLJIT that supports lazy function-at-a-time compilation of LLVM IR. More...
 
class  LLLazyJITBuilder
 Constructs LLLazyJIT instances. More...
 
class  LLLazyJITBuilderSetters
 
class  LLLazyJITBuilderState
 
class  LocalCXXRuntimeOverrides
 
class  LocalCXXRuntimeOverridesBase
 Support class for static dtor execution. More...
 
class  LocalIndirectStubsInfo
 
class  LocalIndirectStubsManager
 IndirectStubsManager implementation for the host architecture, e.g. More...
 
class  LocalJITCompileCallbackManager
 Manage compile callbacks for in-process JITs. More...
 
class  LocalLazyCallThroughManager
 A lazy call-through manager that builds trampolines in the current process. More...
 
class  LocalTrampolinePool
 A trampoline pool for trampolines within the current process. More...
 
class  LookupState
 Wraps state for a lookup-in-progress. More...
 
class  MachOJITDylibDeinitializers
 
struct  MachOJITDylibInitializers
 
struct  MachOPerObjectSectionsToRegister
 
class  MachOPlatform
 Mediates between MachO initialization and ExecutionSession state. More...
 
class  MangleAndInterner
 Mangles symbol names then uniques them in the context of an ExecutionSession. More...
 
class  MaterializationResponsibility
 Tracks responsibility for materialization, and mediates interactions between MaterializationUnits and JDs. More...
 
class  MaterializationTask
 A materialization task. More...
 
class  MaterializationUnit
 A MaterializationUnit represents a set of symbol definitions that can be materialized as a group, or individually discarded (when overriding definitions are encountered). More...
 
class  MissingSymbolDefinitions
 Errors of this type should be returned if a module fails to include definitions that are claimed by the module's associated MaterializationResponsibility. More...
 
class  ObjectLayer
 Interface for Layers that accept object files. More...
 
class  ObjectLinkingLayer
 An ObjectLayer implementation built on JITLink. More...
 
class  ObjectLinkingLayerJITLinkContext
 
class  ObjectTransformLayer
 
class  OrcAArch64
 
class  OrcGenericABI
 Generic ORC ABI support. More...
 
class  OrcI386
 I386 support. More...
 
class  OrcMips32_Base
 
class  OrcMips32Be
 
class  OrcMips32Le
 
class  OrcMips64
 
class  OrcRPCEPCJITLinkMemoryManager
 JITLinkMemoryManager implementation for a process connected via an ORC RPC endpoint. More...
 
class  OrcRPCEPCMemoryAccess
 ExecutorProcessControl::MemoryAccess implementation for a process connected via an ORC RPC endpoint. More...
 
class  OrcRPCExecutorProcessControlBase
 
class  OrcRPCTPCServer
 TargetProcessControl for a process connected via an ORC RPC Endpoint. More...
 
class  OrcV2CAPIHelper
 
class  OrcX86_64_Base
 X86_64 code that's common to all ABIs. More...
 
class  OrcX86_64_SysV
 X86_64 support for SysV ABI (Linux, MacOSX). More...
 
class  OrcX86_64_Win32
 X86_64 support for Win32. More...
 
class  PartitioningIRMaterializationUnit
 
class  Platform
 Platforms set up standard symbols and mediate interactions between dynamic initializers (e.g. More...
 
class  ReexportsGenerator
 ReexportsGenerator can be used with JITDylib::addGenerator to automatically re-export a subset of the source JITDylib's symbols in the target. More...
 
class  ReExportsMaterializationUnit
 A materialization unit for symbol aliases. More...
 
struct  RemoteSymbolLookup
 
struct  RemoteSymbolLookupSetElement
 
class  ResourceManager
 Listens for ResourceTracker operations. More...
 
class  ResourceTracker
 API to remove / transfer ownership of JIT resources. More...
 
class  ResourceTrackerDefunct
 
class  RTDyldObjectLinkingLayer
 
class  SelfExecutorProcessControl
 A ExecutorProcessControl implementation targeting the current process. More...
 
class  SequenceBBQuery
 
class  SimpleCompiler
 Simple compile functor: Takes a single IR module and returns an ObjectFile. More...
 
class  SimpleRemoteEPC
 
struct  SimpleRemoteEPCExecutorInfo
 
class  SimpleRemoteEPCServer
 A simple EPC server implementation. More...
 
class  SimpleRemoteEPCTransport
 
class  SimpleRemoteEPCTransportClient
 
class  SpeculateQuery
 
class  Speculator
 
class  StaticInitGVIterator
 This iterator provides a convenient way to iterate over GlobalValues that have initialization effects. More...
 
class  StaticLibraryDefinitionGenerator
 A utility class to expose symbols from a static library. More...
 
struct  SymbolAliasMapEntry
 
class  SymbolLinkagePromoter
 Promotes private symbols to global hidden, and renames to prevent clashes with other promoted symbols. More...
 
class  SymbolLookupSet
 A set of symbols to look up, each associated with a SymbolLookupFlags value. More...
 
class  SymbolsCouldNotBeRemoved
 Used to notify clients that a set of symbols could not be removed. More...
 
class  SymbolsNotFound
 Used to notify clients when symbols can not be found during a lookup. More...
 
class  SymbolStringPool
 String pool for symbol names used by the JIT. More...
 
class  SymbolStringPtr
 Pointer to a pooled string representing a symbol name. More...
 
class  Task
 Represents an abstract task for ORC to run. More...
 
class  ThreadSafeContext
 An LLVMContext together with an associated mutex that can be used to lock the context to prevent concurrent access by other threads. More...
 
class  ThreadSafeModule
 An LLVM Module together with a shared ThreadSafeContext. More...
 
class  TMOwningSimpleCompiler
 A SimpleCompiler that owns its TargetMachine. More...
 
class  TrampolinePool
 Base class for pools of compiler re-entry trampolines. More...
 
class  UnexpectedSymbolDefinitions
 Errors of this type should be returned if a module contains definitions for symbols that are not claimed by the module's associated MaterializationResponsibility. More...
 
class  UnsupportedExecutorProcessControl
 A ExecutorProcessControl instance that asserts if any of its methods are used. More...
 

Typedefs

using ResourceTrackerSP = uint8_t IntrusiveRefCntPtr< ResourceTracker >
 
using JITDylibSP = IntrusiveRefCntPtr< JITDylib >
 
using ResourceKey = uintptr_t
 
using SymbolNameSet = DenseSet< SymbolStringPtr >
 A set of symbol names (represented by SymbolStringPtrs for. More...
 
using SymbolNameVector = std::vector< SymbolStringPtr >
 A vector of symbol names. More...
 
using SymbolMap = DenseMap< SymbolStringPtr, JITEvaluatedSymbol >
 A map from symbol names (as SymbolStringPtrs) to JITSymbols (address/flags pairs). More...
 
using SymbolFlagsMap = DenseMap< SymbolStringPtr, JITSymbolFlags >
 A map from symbol names (as SymbolStringPtrs) to JITSymbolFlags. More...
 
using SymbolDependenceMap = DenseMap< JITDylib *, SymbolNameSet >
 A map from JITDylibs to sets of symbols. More...
 
using JITDylibSearchOrder = std::vector< std::pair< JITDylib *, JITDylibLookupFlags > >
 A list of (JITDylib*, JITDylibLookupFlags) pairs to be used as a search order during symbol lookup. More...
 
using SymbolAliasMap = DenseMap< SymbolStringPtr, SymbolAliasMapEntry >
 A map of Symbols to (Symbol, Flags) pairs. More...
 
using SymbolsResolvedCallback = unique_function< void(Expected< SymbolMap >)>
 Callback to notify client that symbols have been resolved. More...
 
using RegisterDependenciesFunction = std::function< void(const SymbolDependenceMap &)>
 Callback to register the dependencies for a given query. More...
 
using ELFNixJITDylibInitializerSequence = std::vector< ELFNixJITDylibInitializers >
 
using ELFNixJITDylibDeinitializerSequence = std::vector< ELFNixJITDylibDeinitializers >
 
using MachOJITDylibInitializerSequence = std::vector< MachOJITDylibInitializers >
 
using MachOJITDylibDeinitializerSequence = std::vector< MachOJITDylibDeinitializers >
 
using SimpleRemoteEPCArgBytesVector = SmallVector< char, 128 >
 
using RemoteSymbolLookupSet = std::vector< RemoteSymbolLookupSetElement >
 
using GVPredicate = std::function< bool(const GlobalValue &)>
 
using GVModifier = std::function< void(GlobalValue &)>
 
using BaseT = RTTIExtends< ObjectLinkingLayer, ObjectLayer >
 

Enumerations

enum  JITDylibLookupFlags { JITDylibLookupFlags::MatchExportedSymbolsOnly, JITDylibLookupFlags::MatchAllSymbols }
 Lookup flags that apply to each dylib in the search order for a lookup. More...
 
enum  SymbolLookupFlags { SymbolLookupFlags::RequiredSymbol, SymbolLookupFlags::WeaklyReferencedSymbol }
 Lookup flags that apply to each symbol in a lookup. More...
 
enum  LookupKind { LookupKind::Static, LookupKind::DLSym }
 Describes the kind of lookup being performed. More...
 
enum  SymbolState : uint8_t {
  SymbolState::Invalid, SymbolState::NeverSearched, SymbolState::Materializing, SymbolState::Resolved,
  SymbolState::Emitted, SymbolState::Ready = 0x3f
}
 Represents the state that a symbol has reached during materialization. More...
 
enum  OrcErrorCode : int {
  OrcErrorCode::UnknownORCError = 1, OrcErrorCode::DuplicateDefinition, OrcErrorCode::JITSymbolNotFound, OrcErrorCode::RemoteAllocatorDoesNotExist,
  OrcErrorCode::RemoteAllocatorIdAlreadyInUse, OrcErrorCode::RemoteMProtectAddrUnrecognized, OrcErrorCode::RemoteIndirectStubsOwnerDoesNotExist, OrcErrorCode::RemoteIndirectStubsOwnerIdAlreadyInUse,
  OrcErrorCode::RPCConnectionClosed, OrcErrorCode::RPCCouldNotNegotiateFunction, OrcErrorCode::RPCResponseAbandoned, OrcErrorCode::UnexpectedRPCCall,
  OrcErrorCode::UnexpectedRPCResponse, OrcErrorCode::UnknownErrorCodeFromRemote, OrcErrorCode::UnknownResourceHandle, OrcErrorCode::MissingSymbolDefinitions,
  OrcErrorCode::UnexpectedSymbolDefinitions
}
 
enum  SimpleRemoteEPCOpcode : uint8_t {
  SimpleRemoteEPCOpcode::Setup, SimpleRemoteEPCOpcode::Hangup, SimpleRemoteEPCOpcode::Result, SimpleRemoteEPCOpcode::CallWrapper,
  SimpleRemoteEPCOpcode::LastOpC = CallWrapper
}
 
enum  Requirement { Requirement::ReportFinalSectionLoadAddresses }
 

Functions

IRSymbolMapper::ManglingOptions irManglingOptionsFromTargetOptions (const TargetOptions &Opts)
 
JITDylibSearchOrder makeJITDylibSearchOrder (ArrayRef< JITDylib * > JDs, JITDylibLookupFlags Flags=JITDylibLookupFlags::MatchExportedSymbolsOnly)
 Convenience function for creating a search order from an ArrayRef of JITDylib*, all with the same flags. More...
 
std::unique_ptr< AbsoluteSymbolsMaterializationUnitabsoluteSymbols (SymbolMap Symbols)
 Create an AbsoluteSymbolsMaterializationUnit with the given symbols. More...
 
std::unique_ptr< ReExportsMaterializationUnitsymbolAliases (SymbolAliasMap Aliases)
 Create a ReExportsMaterializationUnit with the given aliases. More...
 
std::unique_ptr< ReExportsMaterializationUnitreexports (JITDylib &SourceJD, SymbolAliasMap Aliases, JITDylibLookupFlags SourceJDLookupFlags=JITDylibLookupFlags::MatchExportedSymbolsOnly)
 Create a materialization unit for re-exporting symbols from another JITDylib with alternative names/flags. More...
 
Expected< SymbolAliasMapbuildSimpleReexportsAliasMap (JITDylib &SourceJD, const SymbolNameSet &Symbols)
 Build a SymbolAliasMap for the common case where you want to re-export symbols from another JITDylib with the same linkage/flags. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const SymbolStringPtr &Sym)
 Render a SymbolStringPtr. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const SymbolNameSet &Symbols)
 Render a SymbolNameSet. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const SymbolNameVector &Symbols)
 Render a SymbolNameVector. More...
 
raw_ostreamoperator<< (raw_ostream &OS, ArrayRef< SymbolStringPtr > Symbols)
 Render an array of SymbolStringPtrs. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const JITSymbolFlags &Flags)
 Render JITSymbolFlags. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const SymbolFlagsMap::value_type &KV)
 Render a SymbolFlagsMap entry. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const SymbolMap::value_type &KV)
 Render a SymbolMap entry. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const SymbolFlagsMap &SymbolFlags)
 Render a SymbolFlagsMap. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const SymbolMap &Symbols)
 Render a SymbolMap. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const SymbolDependenceMap::value_type &KV)
 Render a SymbolDependenceMap entry. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const SymbolDependenceMap &Deps)
 Render a SymbolDependendeMap. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const MaterializationUnit &MU)
 Render a MaterializationUnit. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const JITDylibLookupFlags &JDLookupFlags)
 
raw_ostreamoperator<< (raw_ostream &OS, const SymbolLookupFlags &LookupFlags)
 Rendar a SymbolLookupFlags instance. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const LookupKind &K)
 Render a JITDylibLookupFlags instance. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const SymbolLookupSet::value_type &KV)
 Render a SymbolLookupSet entry. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const SymbolLookupSet &LookupSet)
 Render a SymbolLookupSet. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const JITDylibSearchOrder &SearchOrder)
 Render a JITDylibSearchOrder. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const SymbolAliasMap &Aliases)
 Render a SymbolAliasMap. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const SymbolState &S)
 Render a SymbolState. More...
 
Expected< std::unique_ptr< EPCDebugObjectRegistrar > > createJITLoaderGDBRegistrar (ExecutionSession &ES)
 Create a ExecutorProcessControl-based DebugObjectRegistrar that emits debug objects to the GDB JIT interface. More...
 
Error setUpInProcessLCTMReentryViaEPCIU (EPCIndirectionUtils &EPCIU)
 This will call writeResolver on the given EPCIndirectionUtils instance to set up re-entry via a function that will directly return the trampoline landing address. More...
 
iterator_range< CtorDtorIteratorgetConstructors (const Module &M)
 Create an iterator range over the entries of the llvm.global_ctors array. More...
 
iterator_range< CtorDtorIteratorgetDestructors (const Module &M)
 Create an iterator range over the entries of the llvm.global_ctors array. More...
 
iterator_range< StaticInitGVIteratorgetStaticInitGVs (Module &M)
 Create an iterator range over the GlobalValues that contribute to static initialization. More...
 
Expected< std::unique_ptr< JITCompileCallbackManager > > createLocalCompileCallbackManager (const Triple &T, ExecutionSession &ES, JITTargetAddress ErrorHandlerAddress)
 Create a local compile callback manager. More...
 
std::function< std::unique_ptr< IndirectStubsManager >)> createLocalIndirectStubsManagerBuilder (const Triple &T)
 Create a local indriect stubs manager builder. More...
 
ConstantcreateIRTypedAddress (FunctionType &FT, JITTargetAddress Addr)
 Build a function pointer of FunctionType with the given constant address. More...
 
GlobalVariablecreateImplPointer (PointerType &PT, Module &M, const Twine &Name, Constant *Initializer)
 Create a function pointer with the given type, name, and initializer in the given Module. More...
 
void makeStub (Function &F, Value &ImplPointer)
 Turn a function declaration into a stub function that makes an indirect call using the given function pointer. More...
 
FunctioncloneFunctionDecl (Module &Dst, const Function &F, ValueToValueMapTy *VMap=nullptr)
 Clone a function declaration into a new module. More...
 
void moveFunctionBody (Function &OrigF, ValueToValueMapTy &VMap, ValueMaterializer *Materializer=nullptr, Function *NewF=nullptr)
 Move the body of function 'F' to a cloned function declaration in a different module (See related cloneFunctionDecl). More...
 
GlobalVariablecloneGlobalVariableDecl (Module &Dst, const GlobalVariable &GV, ValueToValueMapTy *VMap=nullptr)
 Clone a global variable declaration into a new module. More...
 
void moveGlobalVariableInitializer (GlobalVariable &OrigGV, ValueToValueMapTy &VMap, ValueMaterializer *Materializer=nullptr, GlobalVariable *NewGV=nullptr)
 Move global variable GV from its parent module to cloned global declaration in a different module. More...
 
GlobalAliascloneGlobalAliasDecl (Module &Dst, const GlobalAlias &OrigA, ValueToValueMapTy &VMap)
 Clone a global alias declaration into a new module. More...
 
void cloneModuleFlagsMetadata (Module &Dst, const Module &Src, ValueToValueMapTy &VMap)
 Clone module flags metadata into the destination module. More...
 
Expected< std::unique_ptr< LazyCallThroughManager > > createLocalLazyCallThroughManager (const Triple &T, ExecutionSession &ES, JITTargetAddress ErrorHandlerAddr)
 Create a LocalLazyCallThroughManager from the given triple and execution session. More...
 
std::unique_ptr< LazyReexportsMaterializationUnitlazyReexports (LazyCallThroughManager &LCTManager, IndirectStubsManager &ISManager, JITDylib &SourceJD, SymbolAliasMap CallableAliases, ImplSymbolMap *SrcJDLoc=nullptr)
 Define lazy-reexports based on the given SymbolAliasMap. More...
 
void setUpGenericLLVMIRPlatform (LLJIT &J)
 Configure the LLJIT instance to scrape modules for llvm.global_ctors and llvm.global_dtors variables and (if present) build initialization and deinitialization functions. More...
 
Error setUpInactivePlatform (LLJIT &J)
 Configure the LLJIT instance to disable platform support explicitly. More...
 
void lookupAndRecordAddrs (unique_function< void(Error)> OnRecorded, ExecutionSession &ES, LookupKind K, const JITDylibSearchOrder &SearchOrder, std::vector< std::pair< SymbolStringPtr, ExecutorAddr * >> Pairs, SymbolLookupFlags LookupFlags=SymbolLookupFlags::RequiredSymbol)
 Record addresses of the given symbols in the given ExecutorAddrs. More...
 
Error lookupAndRecordAddrs (ExecutionSession &ES, LookupKind K, const JITDylibSearchOrder &SearchOrder, std::vector< std::pair< SymbolStringPtr, ExecutorAddr * >> Pairs, SymbolLookupFlags LookupFlags=SymbolLookupFlags::RequiredSymbol)
 Record addresses of the given symbols in the given ExecutorAddrs. More...
 
Error lookupAndRecordAddrs (ExecutorProcessControl &EPC, tpctypes::DylibHandle H, std::vector< std::pair< SymbolStringPtr, ExecutorAddr * >> Pairs, SymbolLookupFlags LookupFlags=SymbolLookupFlags::RequiredSymbol)
 Record addresses of given symbols in the given ExecutorAddrs. More...
 
Expected< std::pair< SymbolFlagsMap, SymbolStringPtr > > getObjectSymbolInfo (ExecutionSession &ES, MemoryBufferRef ObjBuffer)
 Returns a SymbolFlagsMap for the object file represented by the given buffer, or an error if the buffer does not contain a valid object file. More...
 
template<typename ORCABI >
IndirectStubsAllocationSizes getIndirectStubsBlockSizes (unsigned MinStubs, unsigned RoundToMultipleOf=0)
 
ExecutorAddrDiff operator- (const ExecutorAddr &LHS, const ExecutorAddr &RHS)
 Subtracting two addresses yields an offset. More...
 
ExecutorAddr operator+ (const ExecutorAddr &LHS, const ExecutorAddrDiff &RHS)
 Adding an offset and an address yields an address. More...
 
ExecutorAddr operator+ (const ExecutorAddrDiff &LHS, const ExecutorAddr &RHS)
 Adding an address and an offset yields an address. More...
 
std::error_code orcError (OrcErrorCode ErrCode)
 
Error registerEHFrameSection (const void *EHFrameSectionAddr, size_t EHFrameSectionSize)
 Register frames in the given eh-frame section with libunwind. More...
 
Error deregisterEHFrameSection (const void *EHFrameSectionAddr, size_t EHFrameSectionSize)
 Unregister frames in the given eh-frame section with libunwind. More...
 
int runAsMain (int(*Main)(int, char *[]), ArrayRef< std::string > Args, Optional< StringRef > ProgramName=None)
 Run a main function, returning the result. More...
 
ThreadSafeModule cloneToNewContext (const ThreadSafeModule &TSMW, GVPredicate ShouldCloneDef=GVPredicate(), GVModifier UpdateClonedDefSource=GVModifier())
 Clones the given module on to a new context. More...
 
Expected< SymbolAliasMapbuildSimpleReexportsAliasMap (JITDylib &SourceJD, SymbolNameSet Symbols)
 
static bool isDwarfSection (StringRef SectionName)
 
static Expected< std::unique_ptr< DebugObject > > createDebugObjectFromBuffer (ExecutionSession &ES, LinkGraph &G, JITLinkContext &Ctx, MemoryBufferRef ObjBuffer)
 Creates a debug object based on the input object file from ObjectLinkingLayerJITLinkContext. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const JITEvaluatedSymbol &Sym)
 
static void addAliases (ExecutionSession &ES, SymbolAliasMap &Aliases, ArrayRef< std::pair< const char *, const char * >> AL)
 
static JITTargetAddress reentry (JITTargetAddress LCTMAddr, JITTargetAddress TrampolineAddr)
 
static void addAliases (ExecutionSession &ES, SymbolAliasMap &Aliases, ArrayRef< std::pair< const char *, const char * >> AL)
 
static SymbolStringPtr addInitSymbol (SymbolFlagsMap &SymbolFlags, ExecutionSession &ES, StringRef ObjFileName)
 
static Expected< std::pair< SymbolFlagsMap, SymbolStringPtr > > getMachOObjectFileSymbolInfo (ExecutionSession &ES, const object::MachOObjectFile &Obj)
 
static Expected< std::pair< SymbolFlagsMap, SymbolStringPtr > > getELFObjectFileSymbolInfo (ExecutionSession &ES, const object::ELFObjectFileBase &Obj)
 
Expected< std::pair< SymbolFlagsMap, SymbolStringPtr > > getGenericObjectFileSymbolInfo (ExecutionSession &ES, const object::ObjectFile &Obj)
 
static Error makeUnexpectedEOFError ()
 
void __register_frame (const void *)
 
void __deregister_frame (const void *)
 
Error registerFrameWrapper (const void *P)
 
Error deregisterFrameWrapper (const void *P)
 

Variables

RegisterDependenciesFunction NoDependenciesToRegister
 This can be used as the value for a RegisterDependenciesFunction if there are no dependants to register with. More...
 
static constexpr sys::Memory::ProtectionFlags ReadOnly
 
static const std::set< StringRefDwarfSectionNames
 

Typedef Documentation

◆ BaseT

Definition at line 614 of file ObjectLinkingLayer.cpp.

◆ ELFNixJITDylibDeinitializerSequence

Definition at line 52 of file ELFNixPlatform.h.

◆ ELFNixJITDylibInitializerSequence

Definition at line 49 of file ELFNixPlatform.h.

◆ GVModifier

Definition at line 161 of file ThreadSafeModule.h.

◆ GVPredicate

Definition at line 160 of file ThreadSafeModule.h.

◆ JITDylibSearchOrder

using llvm::orc::JITDylibSearchOrder = typedef std::vector<std::pair<JITDylib *, JITDylibLookupFlags> >

A list of (JITDylib*, JITDylibLookupFlags) pairs to be used as a search order during symbol lookup.

Definition at line 153 of file Core.h.

◆ JITDylibSP

Definition at line 47 of file Core.h.

◆ MachOJITDylibDeinitializerSequence

Definition at line 53 of file MachOPlatform.h.

◆ MachOJITDylibInitializerSequence

Definition at line 50 of file MachOPlatform.h.

◆ RegisterDependenciesFunction

Callback to register the dependencies for a given query.

Definition at line 398 of file Core.h.

◆ RemoteSymbolLookupSet

Definition at line 134 of file SimpleRemoteEPCUtils.h.

◆ ResourceKey

using llvm::orc::ResourceKey = typedef uintptr_t

Definition at line 49 of file Core.h.

◆ ResourceTrackerSP

Definition at line 46 of file Core.h.

◆ SimpleRemoteEPCArgBytesVector

Definition at line 50 of file SimpleRemoteEPCUtils.h.

◆ SymbolAliasMap

A map of Symbols to (Symbol, Flags) pairs.

Definition at line 391 of file Core.h.

◆ SymbolDependenceMap

A map from JITDylibs to sets of symbols.

Definition at line 118 of file Core.h.

◆ SymbolFlagsMap

A map from symbol names (as SymbolStringPtrs) to JITSymbolFlags.

Definition at line 115 of file Core.h.

◆ SymbolMap

A map from symbol names (as SymbolStringPtrs) to JITSymbols (address/flags pairs).

Definition at line 112 of file Core.h.

◆ SymbolNameSet

A set of symbol names (represented by SymbolStringPtrs for.

Definition at line 105 of file Core.h.

◆ SymbolNameVector

using llvm::orc::SymbolNameVector = typedef std::vector<SymbolStringPtr>

A vector of symbol names.

Definition at line 108 of file Core.h.

◆ SymbolsResolvedCallback

Callback to notify client that symbols have been resolved.

Definition at line 394 of file Core.h.

Enumeration Type Documentation

◆ JITDylibLookupFlags

Lookup flags that apply to each dylib in the search order for a lookup.

If MatchHiddenSymbolsOnly is used (the default) for a given dylib, then only symbols in that Dylib's interface will be searched. If MatchHiddenSymbols is used then symbols with hidden visibility will match as well.

Enumerator
MatchExportedSymbolsOnly 
MatchAllSymbols 

Definition at line 126 of file Core.h.

◆ LookupKind

enum llvm::orc::LookupKind
strong

Describes the kind of lookup being performed.

The lookup kind is passed to symbol generators (if they're invoked) to help them determine what definitions to generate.

Static – Lookup is being performed as-if at static link time (e.g. generators representing static archives should pull in new definitions).

DLSym – Lookup is being performed as-if at runtime (e.g. generators representing static archives should not pull in new definitions).

Enumerator
Static 
DLSym 

Definition at line 148 of file Core.h.

◆ OrcErrorCode

Enumerator
UnknownORCError 
DuplicateDefinition 
JITSymbolNotFound 
RemoteAllocatorDoesNotExist 
RemoteAllocatorIdAlreadyInUse 
RemoteMProtectAddrUnrecognized 
RemoteIndirectStubsOwnerDoesNotExist 
RemoteIndirectStubsOwnerIdAlreadyInUse 
RPCConnectionClosed 
RPCCouldNotNegotiateFunction 
RPCResponseAbandoned 
UnexpectedRPCCall 
UnexpectedRPCResponse 
UnknownErrorCodeFromRemote 
UnknownResourceHandle 
MissingSymbolDefinitions 
UnexpectedSymbolDefinitions 

Definition at line 24 of file OrcError.h.

◆ Requirement

Enumerator
ReportFinalSectionLoadAddresses 

Definition at line 114 of file DebugObjectManagerPlugin.cpp.

◆ SimpleRemoteEPCOpcode

enum llvm::orc::SimpleRemoteEPCOpcode : uint8_t
strong
Enumerator
Setup 
Hangup 
Result 
CallWrapper 
LastOpC 

Definition at line 36 of file SimpleRemoteEPCUtils.h.

◆ SymbolLookupFlags

Lookup flags that apply to each symbol in a lookup.

If RequiredSymbol is used (the default) for a given symbol then that symbol must be found during the lookup or the lookup will fail returning a SymbolNotFound error. If WeaklyReferencedSymbol is used and the given symbol is not found then the query will continue, and no result for the missing symbol will be present in the result (assuming the rest of the lookup succeeds).

Enumerator
RequiredSymbol 
WeaklyReferencedSymbol 

Definition at line 136 of file Core.h.

◆ SymbolState

enum llvm::orc::SymbolState : uint8_t
strong

Represents the state that a symbol has reached during materialization.

Enumerator
Invalid 
NeverSearched 

No symbol should be in this state.

Materializing 

Added to the symbol table, never queried.

Resolved 

Queried, materialization begun.

Emitted 

Assigned address, still materializing.

Ready 

Emitted to memory, but waiting on transitive dependencies.

Definition at line 799 of file Core.h.

Function Documentation

◆ __deregister_frame()

void llvm::orc::__deregister_frame ( const void *  )

Referenced by deregisterFrameWrapper().

◆ __register_frame()

void llvm::orc::__register_frame ( const void *  )

Referenced by registerFrameWrapper().

◆ absoluteSymbols()

std::unique_ptr<AbsoluteSymbolsMaterializationUnit> llvm::orc::absoluteSymbols ( SymbolMap  Symbols)
inline

Create an AbsoluteSymbolsMaterializationUnit with the given symbols.

Useful for inserting absolute symbols into a JITDylib. E.g.:

JITDylib &JD = ...;
SymbolStringPtr Foo = ...;
JITEvaluatedSymbol FooSym = ...;
if (auto Err = JD.define(absoluteSymbols({{Foo, FooSym}})))
return Err;

Definition at line 732 of file Core.h.

References move.

Referenced by llvm::orc::Speculator::addSpeculationRuntime(), llvm::orc::LocalCXXRuntimeOverrides::enable(), LLVMOrcAbsoluteSymbols(), llvm::orc::EPCDynamicLibrarySearchGenerator::tryToGenerate(), and llvm::orc::DynamicLibrarySearchGenerator::tryToGenerate().

◆ addAliases() [1/2]

static void llvm::orc::addAliases ( ExecutionSession ES,
SymbolAliasMap Aliases,
ArrayRef< std::pair< const char *, const char * >>  AL 
)
static

◆ addAliases() [2/2]

static void llvm::orc::addAliases ( ExecutionSession ES,
SymbolAliasMap Aliases,
ArrayRef< std::pair< const char *, const char * >>  AL 
)
static

◆ addInitSymbol()

static SymbolStringPtr llvm::orc::addInitSymbol ( SymbolFlagsMap SymbolFlags,
ExecutionSession ES,
StringRef  ObjFileName 
)
static

◆ buildSimpleReexportsAliasMap() [1/2]

Expected<SymbolAliasMap> llvm::orc::buildSimpleReexportsAliasMap ( JITDylib SourceJD,
const SymbolNameSet Symbols 
)

Build a SymbolAliasMap for the common case where you want to re-export symbols from another JITDylib with the same linkage/flags.

◆ buildSimpleReexportsAliasMap() [2/2]

Expected<SymbolAliasMap> llvm::orc::buildSimpleReexportsAliasMap ( JITDylib SourceJD,
SymbolNameSet  Symbols 
)

◆ cloneFunctionDecl()

Function * llvm::orc::cloneFunctionDecl ( Module Dst,
const Function F,
ValueToValueMapTy VMap = nullptr 
)

Clone a function declaration into a new module.

This function can be used as the first step towards creating a callback stub (see makeStub), or moving a function body (see moveFunctionBody).

If the VMap argument is non-null, a mapping will be added between F and the new declaration, and between each of F's arguments and the new declaration's arguments. This map can then be passed in to moveFunction to move the function body if required. Note: When moving functions between modules with these utilities, all decls should be cloned (and added to a single VMap) before any bodies are moved. This will ensure that references between functions all refer to the versions in the new module.

Definition at line 287 of file IndirectionUtils.cpp.

References llvm::Function::arg_begin(), llvm::Function::copyAttributesFrom(), llvm::Function::Create(), and F.

Referenced by extractSubModule().

◆ cloneGlobalAliasDecl()

GlobalAlias * llvm::orc::cloneGlobalAliasDecl ( Module Dst,
const GlobalAlias OrigA,
ValueToValueMapTy VMap 
)

◆ cloneGlobalVariableDecl()

GlobalVariable * llvm::orc::cloneGlobalVariableDecl ( Module Dst,
const GlobalVariable GV,
ValueToValueMapTy VMap = nullptr 
)

◆ cloneModuleFlagsMetadata()

void llvm::orc::cloneModuleFlagsMetadata ( Module Dst,
const Module Src,
ValueToValueMapTy VMap 
)

Clone module flags metadata into the destination module.

Definition at line 366 of file IndirectionUtils.cpp.

References llvm::MapMetadata().

◆ cloneToNewContext()

ThreadSafeModule llvm::orc::cloneToNewContext ( const ThreadSafeModule TSMW,
GVPredicate  ShouldCloneDef = GVPredicate(),
GVModifier  UpdateClonedDefSource = GVModifier() 
)

◆ createDebugObjectFromBuffer()

static Expected<std::unique_ptr<DebugObject> > llvm::orc::createDebugObjectFromBuffer ( ExecutionSession ES,
LinkGraph G,
JITLinkContext Ctx,
MemoryBufferRef  ObjBuffer 
)
static

Creates a debug object based on the input object file from ObjectLinkingLayerJITLinkContext.

Definition at line 378 of file DebugObjectManagerPlugin.cpp.

References llvm::Triple::ELF, and G.

Referenced by llvm::orc::DebugObjectManagerPlugin::notifyMaterializing().

◆ createImplPointer()

GlobalVariable * llvm::orc::createImplPointer ( PointerType PT,
Module M,
const Twine Name,
Constant Initializer 
)

Create a function pointer with the given type, name, and initializer in the given Module.

Definition at line 229 of file IndirectionUtils.cpp.

References llvm::GlobalValue::ExternalLinkage, llvm::GlobalValue::HiddenVisibility, M, and llvm::GlobalValue::NotThreadLocal.

◆ createIRTypedAddress()

Constant * llvm::orc::createIRTypedAddress ( FunctionType FT,
JITTargetAddress  Addr 
)

Build a function pointer of FunctionType with the given constant address.

Usage example: Turn a trampoline address into a function pointer constant for use in a stub.

Definition at line 220 of file IndirectionUtils.cpp.

References Addr, llvm::ConstantInt::get(), llvm::PointerType::get(), llvm::ConstantExpr::getCast(), llvm::Type::getContext(), and llvm::Type::getInt64Ty().

◆ createJITLoaderGDBRegistrar()

Expected< std::unique_ptr< EPCDebugObjectRegistrar > > llvm::orc::createJITLoaderGDBRegistrar ( ExecutionSession ES)

Create a ExecutorProcessControl-based DebugObjectRegistrar that emits debug objects to the GDB JIT interface.

Definition at line 20 of file EPCDebugObjectRegistrar.cpp.

References llvm::orc::SymbolLookupSet::add(), assert(), llvm::orc::ExecutionSession::getExecutorProcessControl(), llvm::orc::ExecutorProcessControl::loadDylib(), and llvm::size().

◆ createLocalCompileCallbackManager()

Expected< std::unique_ptr< JITCompileCallbackManager > > llvm::orc::createLocalCompileCallbackManager ( const Triple T,
ExecutionSession ES,
JITTargetAddress  ErrorHandlerAddress 
)

Create a local compile callback manager.

The given target triple will determine the ABI, and the given ErrorHandlerAddress will be used by the resulting compile callback manager if a compile callback fails.

Definition at line 117 of file IndirectionUtils.cpp.

References llvm::Triple::aarch64, llvm::Triple::aarch64_32, llvm::inconvertibleErrorCode(), llvm::Triple::mips, llvm::Triple::mips64, llvm::Triple::mips64el, llvm::Triple::mipsel, llvm::Triple::x86, and llvm::Triple::x86_64.

◆ createLocalIndirectStubsManagerBuilder()

std::function< std::unique_ptr< IndirectStubsManager >)> llvm::orc::createLocalIndirectStubsManagerBuilder ( const Triple T)

Create a local indriect stubs manager builder.

The given target triple will determine the ABI.

Definition at line 164 of file IndirectionUtils.cpp.

References llvm::Triple::aarch64, llvm::Triple::aarch64_32, llvm::Triple::mips, llvm::Triple::mips64, llvm::Triple::mips64el, llvm::Triple::mipsel, llvm::Triple::x86, and llvm::Triple::x86_64.

Referenced by LLVMOrcCreateLocalIndirectStubsManager().

◆ createLocalLazyCallThroughManager()

Expected< std::unique_ptr< LazyCallThroughManager > > llvm::orc::createLocalLazyCallThroughManager ( const Triple T,
ExecutionSession ES,
JITTargetAddress  ErrorHandlerAddr 
)

◆ deregisterEHFrameSection()

Error llvm::orc::deregisterEHFrameSection ( const void *  EHFrameSectionAddr,
size_t  EHFrameSectionSize 
)

Unregister frames in the given eh-frame section with libunwind.

Definition at line 147 of file RegisterEHFrames.cpp.

References deregisterFrameWrapper().

Referenced by llvm::jitlink::InProcessEHFrameRegistrar::deregisterEHFrames(), and deregisterEHFrameWrapper().

◆ deregisterFrameWrapper()

Error llvm::orc::deregisterFrameWrapper ( const void *  P)

Definition at line 41 of file RegisterEHFrames.cpp.

References __deregister_frame(), P, and llvm::Error::success().

Referenced by deregisterEHFrameSection().

◆ getConstructors()

iterator_range< CtorDtorIterator > llvm::orc::getConstructors ( const Module M)

Create an iterator range over the entries of the llvm.global_ctors array.

Definition at line 80 of file ExecutionUtils.cpp.

References M, and llvm::make_range().

◆ getDestructors()

iterator_range< CtorDtorIterator > llvm::orc::getDestructors ( const Module M)

Create an iterator range over the entries of the llvm.global_ctors array.

Definition at line 86 of file ExecutionUtils.cpp.

References M, and llvm::make_range().

◆ getELFObjectFileSymbolInfo()

static Expected<std::pair<SymbolFlagsMap, SymbolStringPtr> > llvm::orc::getELFObjectFileSymbolInfo ( ExecutionSession ES,
const object::ELFObjectFileBase Obj 
)
static

◆ getGenericObjectFileSymbolInfo()

Expected<std::pair<SymbolFlagsMap, SymbolStringPtr> > llvm::orc::getGenericObjectFileSymbolInfo ( ExecutionSession ES,
const object::ObjectFile Obj 
)

◆ getIndirectStubsBlockSizes()

template<typename ORCABI >
IndirectStubsAllocationSizes llvm::orc::getIndirectStubsBlockSizes ( unsigned  MinStubs,
unsigned  RoundToMultipleOf = 0 
)

Definition at line 37 of file OrcABISupport.h.

References llvm::alignTo(), assert(), and llvm::jitlink::x86_64::PointerSize.

◆ getMachOObjectFileSymbolInfo()

static Expected<std::pair<SymbolFlagsMap, SymbolStringPtr> > llvm::orc::getMachOObjectFileSymbolInfo ( ExecutionSession ES,
const object::MachOObjectFile Obj 
)
static

◆ getObjectSymbolInfo()

Expected< std::pair< SymbolFlagsMap, SymbolStringPtr > > llvm::orc::getObjectSymbolInfo ( ExecutionSession ES,
MemoryBufferRef  ObjBuffer 
)

Returns a SymbolFlagsMap for the object file represented by the given buffer, or an error if the buffer does not contain a valid object file.

Definition at line 257 of file Mangling.cpp.

References llvm::object::ObjectFile::createObjectFile(), getELFObjectFileSymbolInfo(), getGenericObjectFileSymbolInfo(), and getMachOObjectFileSymbolInfo().

Referenced by llvm::orc::BasicObjectLayerMaterializationUnit::Create().

◆ getStaticInitGVs()

iterator_range<StaticInitGVIterator> llvm::orc::getStaticInitGVs ( Module M)
inline

Create an iterator range over the GlobalValues that contribute to static initialization.

Definition at line 139 of file ExecutionUtils.h.

References M, and llvm::make_range().

Referenced by llvm::orc::IRMaterializationUnit::IRMaterializationUnit().

◆ irManglingOptionsFromTargetOptions()

IRSymbolMapper::ManglingOptions llvm::orc::irManglingOptionsFromTargetOptions ( const TargetOptions Opts)

◆ isDwarfSection()

static bool llvm::orc::isDwarfSection ( StringRef  SectionName)
static

Definition at line 227 of file DebugObjectManagerPlugin.cpp.

References DwarfSectionNames.

◆ lazyReexports()

std::unique_ptr<LazyReexportsMaterializationUnit> llvm::orc::lazyReexports ( LazyCallThroughManager LCTManager,
IndirectStubsManager ISManager,
JITDylib SourceJD,
SymbolAliasMap  CallableAliases,
ImplSymbolMap SrcJDLoc = nullptr 
)
inline

Define lazy-reexports based on the given SymbolAliasMap.

Each lazy re-export is a callable symbol that will look up and dispatch to the given aliasee on first call. All subsequent calls will go directly to the aliasee.

Definition at line 167 of file LazyReexports.h.

References move.

Referenced by LLVMOrcLazyReexports().

◆ lookupAndRecordAddrs() [1/3]

Error llvm::orc::lookupAndRecordAddrs ( ExecutionSession ES,
LookupKind  K,
const JITDylibSearchOrder SearchOrder,
std::vector< std::pair< SymbolStringPtr, ExecutorAddr * >>  Pairs,
SymbolLookupFlags  LookupFlags = SymbolLookupFlags::RequiredSymbol 
)

Record addresses of the given symbols in the given ExecutorAddrs.

Blocking version.

Definition at line 42 of file LookupAndRecordAddrs.cpp.

References lookupAndRecordAddrs().

◆ lookupAndRecordAddrs() [2/3]

Error llvm::orc::lookupAndRecordAddrs ( ExecutorProcessControl EPC,
tpctypes::DylibHandle  H,
std::vector< std::pair< SymbolStringPtr, ExecutorAddr * >>  Pairs,
SymbolLookupFlags  LookupFlags = SymbolLookupFlags::RequiredSymbol 
)

Record addresses of given symbols in the given ExecutorAddrs.

ExecutorProcessControl lookup version. Lookups are always implicitly weak.

Definition at line 54 of file LookupAndRecordAddrs.cpp.

References H, I, llvm::inconvertibleErrorCode(), llvm::orc::ExecutorProcessControl::lookupSymbols(), and llvm::Error::success().

◆ lookupAndRecordAddrs() [3/3]

void llvm::orc::lookupAndRecordAddrs ( unique_function< void(Error)>  OnRecorded,
ExecutionSession ES,
LookupKind  K,
const JITDylibSearchOrder SearchOrder,
std::vector< std::pair< SymbolStringPtr, ExecutorAddr * >>  Pairs,
SymbolLookupFlags  LookupFlags = SymbolLookupFlags::RequiredSymbol 
)

Record addresses of the given symbols in the given ExecutorAddrs.

Useful for making permanent records of symbol addreses to call or access in the executor (e.g. runtime support functions in Platform subclasses).

By default the symbols are looked up using SymbolLookupFlags::RequiredSymbol, and an error will be generated if any of the requested symbols are not defined.

If SymbolLookupFlags::WeaklyReferencedSymbol is used then any missing symbols will have their corresponding address objects set to zero, and this function will never generate an error (the caller will need to check addresses before using them).

Asynchronous version.

Definition at line 16 of file LookupAndRecordAddrs.cpp.

References for, I, llvm::orc::ExecutionSession::lookup(), move, NoDependenciesToRegister, Ready, and llvm::Error::success().

Referenced by lookupAndRecordAddrs().

◆ makeJITDylibSearchOrder()

JITDylibSearchOrder llvm::orc::makeJITDylibSearchOrder ( ArrayRef< JITDylib * >  JDs,
JITDylibLookupFlags  Flags = JITDylibLookupFlags::MatchExportedSymbolsOnly 
)
inline

◆ makeStub()

void llvm::orc::makeStub ( Function F,
Value ImplPointer 
)

Turn a function declaration into a stub function that makes an indirect call using the given function pointer.

Definition at line 238 of file IndirectionUtils.cpp.

References assert(), Builder, llvm::BasicBlock::Create(), F, and M.

◆ makeUnexpectedEOFError()

static Error llvm::orc::makeUnexpectedEOFError ( )
static

Definition at line 140 of file SimpleRemoteEPCUtils.cpp.

References llvm::inconvertibleErrorCode().

◆ moveFunctionBody()

void llvm::orc::moveFunctionBody ( Function OrigF,
ValueToValueMapTy VMap,
ValueMaterializer Materializer = nullptr,
Function NewF = nullptr 
)

Move the body of function 'F' to a cloned function declaration in a different module (See related cloneFunctionDecl).

If the target function declaration is not supplied via the NewF parameter then it will be looked up via the VMap.

This will delete the body of function 'F' from its original parent module, but leave its declaration.

Definition at line 305 of file IndirectionUtils.cpp.

References assert(), llvm::CloneFunctionInto(), llvm::DifferentModule, llvm::GlobalValue::getParent(), and llvm::GlobalValue::isDeclaration().

◆ moveGlobalVariableInitializer()

void llvm::orc::moveGlobalVariableInitializer ( GlobalVariable OrigGV,
ValueToValueMapTy VMap,
ValueMaterializer Materializer = nullptr,
GlobalVariable NewGV = nullptr 
)

Move global variable GV from its parent module to cloned global declaration in a different module.

If the target global declaration is not supplied via the NewGV parameter then it will be looked up via the VMap.

This will delete the initializer of GV from its original parent module, but leave its declaration.

Definition at line 337 of file IndirectionUtils.cpp.

References assert(), llvm::GlobalValue::getParent(), llvm::GlobalVariable::hasInitializer(), llvm::MapValue(), llvm::RF_None, and llvm::GlobalVariable::setInitializer().

◆ operator+() [1/2]

ExecutorAddr llvm::orc::operator+ ( const ExecutorAddr LHS,
const ExecutorAddrDiff RHS 
)
inline

Adding an offset and an address yields an address.

Definition at line 122 of file ExecutorAddress.h.

References llvm::orc::ExecutorAddrDiff::getValue(), and llvm::orc::ExecutorAddr::getValue().

◆ operator+() [2/2]

ExecutorAddr llvm::orc::operator+ ( const ExecutorAddrDiff LHS,
const ExecutorAddr RHS 
)
inline

Adding an address and an offset yields an address.

Definition at line 128 of file ExecutorAddress.h.

References llvm::orc::ExecutorAddrDiff::getValue(), and llvm::orc::ExecutorAddr::getValue().

◆ operator-()

ExecutorAddrDiff llvm::orc::operator- ( const ExecutorAddr LHS,
const ExecutorAddr RHS 
)
inline

Subtracting two addresses yields an offset.

Definition at line 116 of file ExecutorAddress.h.

References llvm::orc::ExecutorAddr::getValue().

◆ operator<<() [1/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
ArrayRef< SymbolStringPtr Symbols 
)

Render an array of SymbolStringPtrs.

Definition at line 153 of file DebugUtils.cpp.

◆ operator<<() [2/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const JITDylibLookupFlags JDLookupFlags 
)

Definition at line 225 of file DebugUtils.cpp.

References llvm_unreachable, MatchAllSymbols, and MatchExportedSymbolsOnly.

◆ operator<<() [3/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const JITDylibSearchOrder SearchOrder 
)

Render a JITDylibSearchOrder.

Definition at line 256 of file DebugUtils.cpp.

References assert(), and llvm::drop_begin().

◆ operator<<() [4/21]

raw_ostream& llvm::orc::operator<< ( raw_ostream OS,
const JITEvaluatedSymbol Sym 
)

◆ operator<<() [5/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const JITSymbolFlags Flags 
)

◆ operator<<() [6/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const LookupKind K 
)

Render a JITDylibLookupFlags instance.

Render a LookupKind.

Definition at line 215 of file DebugUtils.cpp.

References DLSym, llvm_unreachable, and Static.

◆ operator<<() [7/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const MaterializationUnit MU 
)

◆ operator<<() [8/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const SymbolAliasMap Aliases 
)

Render a SymbolAliasMap.

Definition at line 273 of file DebugUtils.cpp.

◆ operator<<() [9/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const SymbolDependenceMap Deps 
)

Render a SymbolDependendeMap.

Definition at line 203 of file DebugUtils.cpp.

◆ operator<<() [10/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const SymbolDependenceMap::value_type KV 
)

Render a SymbolDependenceMap entry.

Definition at line 198 of file DebugUtils.cpp.

◆ operator<<() [11/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const SymbolFlagsMap SymbolFlags 
)

Render a SymbolFlagsMap.

Definition at line 188 of file DebugUtils.cpp.

◆ operator<<() [12/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const SymbolFlagsMap::value_type KV 
)

Render a SymbolFlagsMap entry.

Definition at line 180 of file DebugUtils.cpp.

◆ operator<<() [13/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const SymbolLookupFlags LookupFlags 
)

Rendar a SymbolLookupFlags instance.

Definition at line 236 of file DebugUtils.cpp.

References llvm_unreachable, RequiredSymbol, and WeaklyReferencedSymbol.

◆ operator<<() [14/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const SymbolLookupSet LookupSet 
)

Render a SymbolLookupSet.

Definition at line 251 of file DebugUtils.cpp.

◆ operator<<() [15/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const SymbolLookupSet::value_type KV 
)

Render a SymbolLookupSet entry.

Definition at line 246 of file DebugUtils.cpp.

◆ operator<<() [16/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const SymbolMap Symbols 
)

Render a SymbolMap.

Definition at line 193 of file DebugUtils.cpp.

◆ operator<<() [17/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const SymbolMap::value_type KV 
)

Render a SymbolMap entry.

Definition at line 184 of file DebugUtils.cpp.

◆ operator<<() [18/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const SymbolNameSet Symbols 
)

Render a SymbolNameSet.

Definition at line 145 of file DebugUtils.cpp.

◆ operator<<() [19/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const SymbolNameVector Symbols 
)

Render a SymbolNameVector.

Definition at line 149 of file DebugUtils.cpp.

◆ operator<<() [20/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const SymbolState S 
)

Render a SymbolState.

Definition at line 282 of file DebugUtils.cpp.

References Emitted, Invalid, llvm_unreachable, Materializing, NeverSearched, Ready, Resolved, and S.

◆ operator<<() [21/21]

raw_ostream & llvm::orc::operator<< ( raw_ostream OS,
const SymbolStringPtr Sym 
)

Render a SymbolStringPtr.

Definition at line 141 of file DebugUtils.cpp.

◆ orcError()

std::error_code llvm::orc::orcError ( OrcErrorCode  ErrCode)

◆ reentry()

static JITTargetAddress llvm::orc::reentry ( JITTargetAddress  LCTMAddr,
JITTargetAddress  TrampolineAddr 
)
static

Definition at line 403 of file EPCIndirectionUtils.cpp.

References Addr.

Referenced by setUpInProcessLCTMReentryViaEPCIU().

◆ reexports()

std::unique_ptr<ReExportsMaterializationUnit> llvm::orc::reexports ( JITDylib SourceJD,
SymbolAliasMap  Aliases,
JITDylibLookupFlags  SourceJDLookupFlags = JITDylibLookupFlags::MatchExportedSymbolsOnly 
)
inline

Create a materialization unit for re-exporting symbols from another JITDylib with alternative names/flags.

SourceJD will be searched using the given JITDylibLookupFlags.

Definition at line 786 of file Core.h.

References move.

Referenced by llvm::orc::ReexportsGenerator::tryToGenerate().

◆ registerEHFrameSection()

Error llvm::orc::registerEHFrameSection ( const void *  EHFrameSectionAddr,
size_t  EHFrameSectionSize 
)

Register frames in the given eh-frame section with libunwind.

Definition at line 128 of file RegisterEHFrames.cpp.

References registerFrameWrapper().

Referenced by llvm::jitlink::InProcessEHFrameRegistrar::registerEHFrames(), and registerEHFrameWrapper().

◆ registerFrameWrapper()

Error llvm::orc::registerFrameWrapper ( const void *  P)

Definition at line 36 of file RegisterEHFrames.cpp.

References __register_frame(), P, and llvm::Error::success().

Referenced by registerEHFrameSection().

◆ runAsMain()

int llvm::orc::runAsMain ( int(*)(int, char *[])  Main,
ArrayRef< std::string >  Args,
Optional< StringRef ProgramName = None 
)

Run a main function, returning the result.

If the optional ProgramName argument is given then it will be inserted before the strings in Args as the first argument to the called function.

It is legal to have an empty argument list and no program name, however many main functions will expect a name argument at least, and will fail if none is provided.

Definition at line 16 of file TargetExecutionUtils.cpp.

References Arg, llvm::AMDGPU::HSAMD::Kernel::Key::Args, and llvm::copy().

Referenced by llvm::orc::SelfExecutorProcessControl::runAsMain(), and llvm::orc::rt_bootstrap::runAsMainWrapper().

◆ setUpGenericLLVMIRPlatform()

void llvm::orc::setUpGenericLLVMIRPlatform ( LLJIT J)

Configure the LLJIT instance to scrape modules for llvm.global_ctors and llvm.global_dtors variables and (if present) build initialization and deinitialization functions.

Platform specific initialization configurations should be preferred where available.

Definition at line 802 of file LLJIT.cpp.

References llvm::dbgs(), LLVM_DEBUG, and llvm::orc::LLJIT::setPlatformSupport().

◆ setUpInactivePlatform()

Error llvm::orc::setUpInactivePlatform ( LLJIT J)

Configure the LLJIT instance to disable platform support explicitly.

This is useful in two cases: for platforms that don't have such requirements and for platforms, that we have no explicit support yet and that don't work well with the generic IR platform.

Definition at line 808 of file LLJIT.cpp.

References llvm::dbgs(), LLVM_DEBUG, llvm::orc::LLJIT::setPlatformSupport(), and llvm::Error::success().

◆ setUpInProcessLCTMReentryViaEPCIU()

Error llvm::orc::setUpInProcessLCTMReentryViaEPCIU ( EPCIndirectionUtils EPCIU)

This will call writeResolver on the given EPCIndirectionUtils instance to set up re-entry via a function that will directly return the trampoline landing address.

The EPCIndirectionUtils' LazyCallThroughManager must have been previously created via EPCIndirectionUtils::createLazyCallThroughManager.

The EPCIndirectionUtils' writeResolver method must not have been previously called.

This function is experimental and likely subject to revision.

Definition at line 414 of file EPCIndirectionUtils.cpp.

References llvm::orc::EPCIndirectionUtils::getLazyCallThroughManager(), llvm::pointerToJITTargetAddress(), reentry(), and llvm::orc::EPCIndirectionUtils::writeResolverBlock().

◆ symbolAliases()

std::unique_ptr<ReExportsMaterializationUnit> llvm::orc::symbolAliases ( SymbolAliasMap  Aliases)
inline

Create a ReExportsMaterializationUnit with the given aliases.

Useful for defining symbol aliases.: E.g., given a JITDylib JD containing symbols "foo" and "bar", we can define aliases "baz" (for "foo") and "qux" (for "bar") with:

SymbolStringPtr Baz = ...;
SymbolStringPtr Qux = ...;
if (auto Err = JD.define(symbolAliases({
{Baz, { Foo, JITSymbolFlags::Exported }},
{Qux, { Bar, JITSymbolFlags::Weak }}}))
return Err;

Definition at line 777 of file Core.h.

References MatchAllSymbols, and move.

Variable Documentation

◆ DwarfSectionNames

const std::set<StringRef> llvm::orc::DwarfSectionNames
static
Initial value:
= {
#define HANDLE_DWARF_SECTION(ENUM_NAME, ELF_NAME, CMDLINE_NAME, OPTION)
}

Definition at line 220 of file DebugObjectManagerPlugin.cpp.

Referenced by isDwarfSection().

◆ NoDependenciesToRegister

RegisterDependenciesFunction llvm::orc::NoDependenciesToRegister
Initial value:

This can be used as the value for a RegisterDependenciesFunction if there are no dependants to register with.

Definition at line 35 of file Core.cpp.

Referenced by llvm::orc::ExecutionSession::lookup(), lookupAndRecordAddrs(), llvm::orc::Platform::lookupInitSymbols(), and llvm::orc::Speculator::registerSymbols().

◆ ReadOnly

constexpr sys::Memory::ProtectionFlags llvm::orc::ReadOnly
staticconstexpr
llvm::orc::RegisterDependenciesFunction
std::function< void(const SymbolDependenceMap &)> RegisterDependenciesFunction
Callback to register the dependencies for a given query.
Definition: Core.h:398
llvm::JITSymbolFlags::Weak
@ Weak
Definition: JITSymbol.h:82
llvm::orc::symbolAliases
std::unique_ptr< ReExportsMaterializationUnit > symbolAliases(SymbolAliasMap Aliases)
Create a ReExportsMaterializationUnit with the given aliases.
Definition: Core.h:777
llvm::orc::absoluteSymbols
std::unique_ptr< AbsoluteSymbolsMaterializationUnit > absoluteSymbols(SymbolMap Symbols)
Create an AbsoluteSymbolsMaterializationUnit with the given symbols.
Definition: Core.h:732
llvm::JITSymbolFlags::Exported
@ Exported
Definition: JITSymbol.h:85