LLVM 19.0.0git
Public Member Functions | Friends | List of all members
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:
Inheritance graph
[legend]

Public Member Functions

 ResourceTracker (const ResourceTracker &)=delete
 
ResourceTrackeroperator= (const ResourceTracker &)=delete
 
 ResourceTracker (ResourceTracker &&)=delete
 
ResourceTrackeroperator= (ResourceTracker &&)=delete
 
 ~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.
 
Error remove ()
 Remove all resources associated with this key.
 
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
 
 ThreadSafeRefCountedBase (const ThreadSafeRefCountedBase &)
 
ThreadSafeRefCountedBaseoperator= (const ThreadSafeRefCountedBase &)=delete
 
 ~ThreadSafeRefCountedBase ()
 

Detailed Description

API to remove / transfer ownership of JIT resources.

Definition at line 56 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

◆ ~ResourceTracker()

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

Member Function Documentation

◆ getJITDylib()

JITDylib & llvm::orc::ResourceTracker::getJITDylib ( ) const
inline

◆ 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 93 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 88 of file Core.h.

Referenced by withResourceKeyDo().

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ remove()

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

Remove all resources associated with this key.

Definition at line 54 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 58 of file Core.cpp.

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

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 1890 of file Core.h.

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

Friends And Related Function Documentation

◆ ExecutionSession

friend class ExecutionSession
friend

Definition at line 58 of file Core.h.

◆ JITDylib

friend class JITDylib
friend

Definition at line 59 of file Core.h.

◆ MaterializationResponsibility

friend class MaterializationResponsibility
friend

Definition at line 60 of file Core.h.


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