LLVM 22.0.0git
llvm::orc::ResourceTracker Class Reference

API to remove / transfer ownership of JIT resources. More...

#include "llvm/ExecutionEngine/Orc/Core.h"

Inheritance diagram for llvm::orc::ResourceTracker:
[legend]

Public Member Functions

 ResourceTracker (const ResourceTracker &)=delete
ResourceTrackeroperator= (const ResourceTracker &)=delete
 ResourceTracker (ResourceTracker &&)=delete
ResourceTrackeroperator= (ResourceTracker &&)=delete
LLVM_ABI ~ResourceTracker ()
JITDylibgetJITDylib () const
 Return the JITDylib targeted by this tracker.
template<typename Func>
Error withResourceKeyDo (Func &&F)
 Runs the given callback under the session lock, passing in the associated ResourceKey.
LLVM_ABI Error remove ()
 Remove all resources associated with this key.
LLVM_ABI void transferTo (ResourceTracker &DstRT)
 Transfer all resources associated with this key to the given tracker, which must target the same JITDylib as this one.
bool isDefunct () const
 Return true if this tracker has become defunct.
ResourceKey getKeyUnsafe () const
 Returns the key associated with this tracker.
Public Member Functions inherited from llvm::ThreadSafeRefCountedBase< ResourceTracker >
unsigned UseCount () const
void Retain () const
void Release () const

Friends

class ExecutionSession
class JITDylib
class MaterializationResponsibility

Additional Inherited Members

Protected Member Functions inherited from llvm::ThreadSafeRefCountedBase< ResourceTracker >
 ThreadSafeRefCountedBase ()=default
ThreadSafeRefCountedBaseoperator= (const ThreadSafeRefCountedBase &)=delete
 ~ThreadSafeRefCountedBase ()

Detailed Description

API to remove / transfer ownership of JIT resources.

Definition at line 78 of file Core.h.

Constructor & Destructor Documentation

◆ ResourceTracker() [1/2]

llvm::orc::ResourceTracker::ResourceTracker ( const ResourceTracker & )
delete

◆ ResourceTracker() [2/2]

llvm::orc::ResourceTracker::ResourceTracker ( ResourceTracker && )
delete

References ResourceTracker().

◆ ~ResourceTracker()

llvm::orc::ResourceTracker::~ResourceTracker ( )

Member Function Documentation

◆ getJITDylib()

◆ getKeyUnsafe()

ResourceKey llvm::orc::ResourceTracker::getKeyUnsafe ( ) const
inline

Returns the key associated with this tracker.

This method should not be used except for debug logging: there is no guarantee that the returned value will remain valid.

Definition at line 115 of file Core.h.

Referenced by withResourceKeyDo().

◆ isDefunct()

bool llvm::orc::ResourceTracker::isDefunct ( ) const
inline

Return true if this tracker has become defunct.

Definition at line 110 of file Core.h.

Referenced by withResourceKeyDo().

◆ operator=() [1/2]

ResourceTracker & llvm::orc::ResourceTracker::operator= ( const ResourceTracker & )
delete

References ResourceTracker().

◆ operator=() [2/2]

ResourceTracker & llvm::orc::ResourceTracker::operator= ( ResourceTracker && )
delete

References LLVM_ABI, and ResourceTracker().

◆ remove()

Error llvm::orc::ResourceTracker::remove ( )

Remove all resources associated with this key.

Definition at line 55 of file Core.cpp.

References llvm::orc::JITDylib::getExecutionSession(), and getJITDylib().

Referenced by LLVMOrcResourceTrackerRemove().

◆ transferTo()

void llvm::orc::ResourceTracker::transferTo ( ResourceTracker & DstRT)

Transfer all resources associated with this key to the given tracker, which must target the same JITDylib as this one.

Definition at line 59 of file Core.cpp.

References llvm::orc::JITDylib::getExecutionSession(), getJITDylib(), and ResourceTracker().

Referenced by LLVMOrcResourceTrackerTransferTo().

◆ withResourceKeyDo()

template<typename Func>
Error llvm::orc::ResourceTracker::withResourceKeyDo ( Func && F)

Runs the given callback under the session lock, passing in the associated ResourceKey.

This is the safe way to associate resources with trackers.

Definition at line 1850 of file Core.h.

References F, llvm::orc::JITDylib::getExecutionSession(), getJITDylib(), getKeyUnsafe(), isDefunct(), llvm::make_error(), llvm::orc::ExecutionSession::runSessionLocked(), and llvm::Error::success().

◆ ExecutionSession

friend class ExecutionSession
friend

Definition at line 80 of file Core.h.

References ExecutionSession.

Referenced by ExecutionSession.

◆ JITDylib

friend class JITDylib
friend

Definition at line 81 of file Core.h.

References JITDylib.

Referenced by getJITDylib(), and JITDylib.

◆ MaterializationResponsibility

friend class MaterializationResponsibility
friend

Definition at line 82 of file Core.h.

References MaterializationResponsibility.

Referenced by MaterializationResponsibility.


The documentation for this class was generated from the following files: