LLVM  14.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::jitlink::SimpleSegmentAlloc Class Reference

A utility class for making simple allocations using JITLinkMemoryManager. More...

#include "llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"

Classes

struct  Segment
 Describes a segment to be allocated. More...
 
struct  SegmentInfo
 Describes the segment working memory and executor address. More...
 

Public Types

using SegmentMap = AllocGroupSmallMap< Segment >
 
using OnCreatedFunction = unique_function< void(Expected< SimpleSegmentAlloc >)>
 
using OnFinalizedFunction = JITLinkMemoryManager::InFlightAlloc::OnFinalizedFunction
 

Public Member Functions

 SimpleSegmentAlloc (SimpleSegmentAlloc &&)
 
SimpleSegmentAllocoperator= (SimpleSegmentAlloc &&)
 
 ~SimpleSegmentAlloc ()
 
SegmentInfo getSegInfo (AllocGroup AG)
 Returns the SegmentInfo for the given group. More...
 
void finalize (OnFinalizedFunction OnFinalized)
 Finalize all groups (async version). More...
 
Expected< JITLinkMemoryManager::FinalizedAllocfinalize ()
 Finalize all groups. More...
 

Static Public Member Functions

static void Create (JITLinkMemoryManager &MemMgr, const JITLinkDylib *JD, SegmentMap Segments, OnCreatedFunction OnCreated)
 
static Expected< SimpleSegmentAllocCreate (JITLinkMemoryManager &MemMgr, const JITLinkDylib *JD, SegmentMap Segments)
 

Detailed Description

A utility class for making simple allocations using JITLinkMemoryManager.

SimpleSegementAlloc takes a mapping of AllocGroups to Segments and uses this to create a LinkGraph with one Section (containing one Block) per Segment. Clients can obtain a pointer to the working memory and executor address of that block using the Segment's AllocGroup. Once memory has been populated, clients can call finalize to finalize the memory.

Definition at line 329 of file JITLinkMemoryManager.h.

Member Typedef Documentation

◆ OnCreatedFunction

Definition at line 349 of file JITLinkMemoryManager.h.

◆ OnFinalizedFunction

Definition at line 352 of file JITLinkMemoryManager.h.

◆ SegmentMap

Definition at line 347 of file JITLinkMemoryManager.h.

Constructor & Destructor Documentation

◆ SimpleSegmentAlloc()

llvm::jitlink::SimpleSegmentAlloc::SimpleSegmentAlloc ( SimpleSegmentAlloc &&  )
default

Referenced by Create().

◆ ~SimpleSegmentAlloc()

llvm::jitlink::SimpleSegmentAlloc::~SimpleSegmentAlloc ( )

Definition at line 264 of file JITLinkMemoryManager.cpp.

Member Function Documentation

◆ Create() [1/2]

Expected< SimpleSegmentAlloc > llvm::jitlink::SimpleSegmentAlloc::Create ( JITLinkMemoryManager MemMgr,
const JITLinkDylib JD,
SegmentMap  Segments 
)
static

Definition at line 250 of file JITLinkMemoryManager.cpp.

References Create(), and move.

◆ Create() [2/2]

void llvm::jitlink::SimpleSegmentAlloc::Create ( JITLinkMemoryManager MemMgr,
const JITLinkDylib JD,
SegmentMap  Segments,
OnCreatedFunction  OnCreated 
)
static

◆ finalize() [1/2]

Expected<JITLinkMemoryManager::FinalizedAlloc> llvm::jitlink::SimpleSegmentAlloc::finalize ( )
inline

Finalize all groups.

Definition at line 374 of file JITLinkMemoryManager.h.

◆ finalize() [2/2]

void llvm::jitlink::SimpleSegmentAlloc::finalize ( OnFinalizedFunction  OnFinalized)
inline

Finalize all groups (async version).

Definition at line 369 of file JITLinkMemoryManager.h.

References move.

◆ getSegInfo()

SimpleSegmentAlloc::SegmentInfo llvm::jitlink::SimpleSegmentAlloc::getSegInfo ( AllocGroup  AG)

Returns the SegmentInfo for the given group.

Definition at line 266 of file JITLinkMemoryManager.cpp.

References B, and I.

◆ operator=()

SimpleSegmentAlloc & llvm::jitlink::SimpleSegmentAlloc::operator= ( SimpleSegmentAlloc &&  )
default

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