Vuo  1.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
VuoCompilerChain Class Reference

Description

A linear sequence of nodes along which an event may be transmitted.

Public Member Functions

 VuoCompilerChain (vector< VuoCompilerNode * > nodes, bool lastNodeInLoop)
 Creates a chain consisting of the given list of nodes.
 
Function * generateSubmissionForDispatchGroup (Module *module, BasicBlock *block, Value *contextValue, string triggerIdentifier)
 Generates code that submits a function for asynchronous execution on the global dispatch queue.
 
void generateWaitForUpstreamChains (Module *module, BasicBlock *block, Value *contextValue, const vector< size_t > &chainIndices)
 Generates code that waits on the dispatch groups for all chains immediately upstream of this chain.
 
void generateCleanupForWorkerFunction (Module *module, BasicBlock *block, Value *contextValue, size_t chainIndex, bool hasDownstreamChains)
 Generates code that decrements the block count of the chain's dispatch group (indicating that other chains no longer need to wait on it) and releases memory.
 
vector< VuoCompilerNode * > getNodes (void)
 Returns the sequence of nodes in this chain.
 
bool isLastNodeInLoop (void)
 Returns true if this chain represents a single node that is the last (and only repeated) node in a feedback loop.
 

Static Public Member Functions

static Value * generateMakeContext (Module *module, BasicBlock *block, Value *compositionIdentifierValue, Value *eventIdValue, const vector< VuoCompilerChain * > &chains, const map< VuoCompilerChain *, vector< VuoCompilerChain * > > &chainsImmediatelyDownstream)
 Generates code to create a context that can be passed to chain worker functions.
 
static Value * generateCompositionIdentifierValue (Module *module, BasicBlock *block, Value *contextValue)
 Generates code that retrieves the composition identifier from the context argument of a chain worker function.
 
static Value * generateEventIdValue (Module *module, BasicBlock *block, Value *contextValue)
 Generates code that retrieves the event ID from the context argument of a chain worker function.
 
static Function * getFreeContextFunction (Module *module)
 Generates code that deallocates the context argument of a chain worker function.
 

Constructor & Destructor Documentation

VuoCompilerChain::VuoCompilerChain ( vector< VuoCompilerNode * >  nodes,
bool  lastNodeInLoop 
)

Creates a chain consisting of the given list of nodes.

Parameters
nodesA linear sequence of nodes.
lastNodeInLoopTrue if this chain represents a single node that is the last (and only repeated) node in a feedback loop.

Member Function Documentation

void VuoCompilerChain::generateCleanupForWorkerFunction ( Module *  module,
BasicBlock *  block,
Value *  contextValue,
size_t  chainIndex,
bool  hasDownstreamChains 
)

Generates code that decrements the block count of the chain's dispatch group (indicating that other chains no longer need to wait on it) and releases memory.

Value * VuoCompilerChain::generateCompositionIdentifierValue ( Module *  module,
BasicBlock *  block,
Value *  contextValue 
)
static

Generates code that retrieves the composition identifier from the context argument of a chain worker function.

Value * VuoCompilerChain::generateEventIdValue ( Module *  module,
BasicBlock *  block,
Value *  contextValue 
)
static

Generates code that retrieves the event ID from the context argument of a chain worker function.

Value * VuoCompilerChain::generateMakeContext ( Module *  module,
BasicBlock *  block,
Value *  compositionIdentifierValue,
Value *  eventIdValue,
const vector< VuoCompilerChain * > &  chains,
const map< VuoCompilerChain *, vector< VuoCompilerChain * > > &  chainsImmediatelyDownstream 
)
static

Generates code to create a context that can be passed to chain worker functions.

The context contains an event ID and an array of dispatch groups. Each dispatch group has a block count of 1.

Function * VuoCompilerChain::generateSubmissionForDispatchGroup ( Module *  module,
BasicBlock *  block,
Value *  contextValue,
string  triggerIdentifier 
)

Generates code that submits a function for asynchronous execution on the global dispatch queue.

contextValue is passed as an argument.

Returns
The submitted function. The caller is responsible for filling in the body of this function.
void VuoCompilerChain::generateWaitForUpstreamChains ( Module *  module,
BasicBlock *  block,
Value *  contextValue,
const vector< size_t > &  chainIndices 
)

Generates code that waits on the dispatch groups for all chains immediately upstream of this chain.

Function * VuoCompilerChain::getFreeContextFunction ( Module *  module)
static

Generates code that deallocates the context argument of a chain worker function.

vector< VuoCompilerNode * > VuoCompilerChain::getNodes ( void  )

Returns the sequence of nodes in this chain.

bool VuoCompilerChain::isLastNodeInLoop ( void  )

Returns true if this chain represents a single node that is the last (and only repeated) node in a feedback loop.


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