Vuo
0.5.3
|
The compiler detail class for VuoNode
.
Public Member Functions | |
VuoCompilerNode (VuoNode *baseNode) | |
Creates a compiler detail for the specified baseNode . | |
void | generateAllocation (Module *module) |
Generates the allocation of the node's runtime representation, which consists of the runtime representations for the ports and the instance data. | |
void | generateEventFunctionCall (Module *module, Function *function, BasicBlock *initialBlock, BasicBlock *finalBlock) |
Generates a call to nodeEvent or nodeInstanceEvent . | |
void | generateInitFunctionCall (Module *module, BasicBlock *block) |
Generates a call to nodeInstanceInit , stores the return value into the node's instance data, and retains the node's instance data. | |
void | generateFiniFunctionCall (Module *module, BasicBlock *block) |
Generates a call to nodeInstanceFini and releases the node's instance data. | |
void | generateCallbackStartFunctionCall (Module *module, BasicBlock *block) |
Generates a call to nodeInstanceTriggerStart , if the function exists. | |
void | generateCallbackUpdateFunctionCall (Module *module, BasicBlock *block) |
Generates a call to nodeInstanceTriggerUpdate , if the function exists. | |
void | generateCallbackStopFunctionCall (Module *module, BasicBlock *block) |
Generates a call to nodeInstanceTriggerStop , if the function exists. | |
Value * | generateReceivedEventCondition (BasicBlock *block) |
Generates a condition that is true if any of this node's input event ports have received an event. | |
void | generatePushedReset (BasicBlock *block) |
Generates code to set all of this node's input and output event ports to an unpushed state. | |
void | generateFinalization (Module *module, BasicBlock *block, bool isInput) |
Releases all reference-counted port values. | |
VuoCompilerInstanceData * | getInstanceData (void) |
If this node is stateful, returns the instance data. | |
string | getIdentifier (void) |
Returns the identifier prefix in the generated LLVM bitcode for this node instance. | |
string | getGraphvizIdentifierPrefix (void) |
Returns a suggested UpperCamelCase prefix for the node's Graphviz identifier, based on its title. | |
void | setGraphvizIdentifier (string graphvizIdentifier) |
Sets the identifier that will appear in .vuo (Graphviz dot format) files. | |
string | getGraphvizIdentifier (void) |
Gets the identifier that will appear in .vuo (Graphviz dot format) files. | |
string | getGraphvizDeclaration (bool shouldPrintPosition=false, double xPositionOffset=0, double yPositionOffset=0) |
Returns a string containing the declaration for this node as it would appear in a .vuo (Graphviz dot format) file. | |
Value * | generateSerializedString (Module *module, BasicBlock *block) |
Generates code that creates a string containing the declaration for this node as it would appear in a .vuo (Graphviz dot format) file. | |
void | generateUnserialization (Module *module, Function *function, BasicBlock *&block, Value *graphValue) |
Generates code that sets the input port values and instance data of this node from the given Graphviz graph (graph_t) value. | |
![]() | |
VuoBaseDetail (string description, VuoNode *base) | |
Creates a VuoNode detail class. | |
VuoNode * | getBase (void) const |
Returns the VuoNode detail class instance's base class instance. | |
void | setBase (VuoNode *base) |
Sets the VuoNode detail class instance's base class instance. | |
VuoCompilerNode::VuoCompilerNode | ( | VuoNode * | baseNode | ) |
Creates a compiler detail for the specified baseNode
.
void VuoCompilerNode::generateAllocation | ( | Module * | module | ) |
Generates the allocation of the node's runtime representation, which consists of the runtime representations for the ports and the instance data.
module | The destination LLVM module (i.e., generated code). |
void VuoCompilerNode::generateCallbackStartFunctionCall | ( | Module * | module, |
BasicBlock * | block | ||
) |
Generates a call to nodeInstanceTriggerStart
, if the function exists.
module | The destination LLVM module (i.e., generated code). |
block | The LLVM block to which to append the function call. |
void VuoCompilerNode::generateCallbackStopFunctionCall | ( | Module * | module, |
BasicBlock * | block | ||
) |
Generates a call to nodeInstanceTriggerStop
, if the function exists.
module | The destination LLVM module (i.e., generated code). |
block | The LLVM block to which to append the function call. |
void VuoCompilerNode::generateCallbackUpdateFunctionCall | ( | Module * | module, |
BasicBlock * | block | ||
) |
Generates a call to nodeInstanceTriggerUpdate
, if the function exists.
module | The destination LLVM module (i.e., generated code). |
block | The LLVM block to which to append the function call. |
void VuoCompilerNode::generateEventFunctionCall | ( | Module * | module, |
Function * | function, | ||
BasicBlock * | initialBlock, | ||
BasicBlock * | finalBlock | ||
) |
Generates a call to nodeEvent
or nodeInstanceEvent
.
The generated code sets up the arguments for the call, does the call, transmits events from input ports to output ports, and handles memory management for the node's runtime representation.
module | The destination LLVM module (i.e., generated code). |
function | The function in which to generate code. |
initialBlock | The block to which the function call will be appended. |
finalBlock | The block following the function call. |
void VuoCompilerNode::generateFinalization | ( | Module * | module, |
BasicBlock * | block, | ||
bool | isInput | ||
) |
Releases all reference-counted port values.
void VuoCompilerNode::generateFiniFunctionCall | ( | Module * | module, |
BasicBlock * | block | ||
) |
Generates a call to nodeInstanceFini
and releases the node's instance data.
Assumes the node is stateful.
module | The destination LLVM module (i.e., generated code). |
block | The LLVM block to which to append the function call. |
void VuoCompilerNode::generateInitFunctionCall | ( | Module * | module, |
BasicBlock * | block | ||
) |
Generates a call to nodeInstanceInit
, stores the return value into the node's instance data, and retains the node's instance data.
Assumes the node is stateful. Assumes any trigger ports' function declarations have been generated.
module | The destination LLVM module (i.e., generated code). |
block | The LLVM block to which to append the function call. |
void VuoCompilerNode::generatePushedReset | ( | BasicBlock * | block | ) |
Generates code to set all of this node's input and output event ports to an unpushed state.
Value * VuoCompilerNode::generateReceivedEventCondition | ( | BasicBlock * | block | ) |
Generates a condition that is true if any of this node's input event ports have received an event.
Value * VuoCompilerNode::generateSerializedString | ( | Module * | module, |
BasicBlock * | block | ||
) |
Generates code that creates a string containing the declaration for this node as it would appear in a .vuo (Graphviz dot format) file.
void VuoCompilerNode::generateUnserialization | ( | Module * | module, |
Function * | function, | ||
BasicBlock *& | block, | ||
Value * | graphValue | ||
) |
Generates code that sets the input port values and instance data of this node from the given Graphviz graph (graph_t) value.
string VuoCompilerNode::getGraphvizDeclaration | ( | bool | shouldPrintPosition = false , |
double | xPositionOffset = 0 , |
||
double | yPositionOffset = 0 |
||
) |
Returns a string containing the declaration for this node as it would appear in a .vuo (Graphviz dot format) file.
string VuoCompilerNode::getGraphvizIdentifier | ( | void | ) |
Gets the identifier that will appear in .vuo (Graphviz dot format) files.
string VuoCompilerNode::getGraphvizIdentifierPrefix | ( | void | ) |
Returns a suggested UpperCamelCase prefix for the node's Graphviz identifier, based on its title.
Removes non-alphanumeric characters, and uppercases the character after each former space. Removes non-alpha leading characters.
string VuoCompilerNode::getIdentifier | ( | void | ) |
Returns the identifier prefix in the generated LLVM bitcode for this node instance.
This identifier is derived from the Graphviz identifier.
VuoCompilerInstanceData * VuoCompilerNode::getInstanceData | ( | void | ) |
If this node is stateful, returns the instance data.
Otherwise null.
void VuoCompilerNode::setGraphvizIdentifier | ( | string | graphvizIdentifier | ) |
Sets the identifier that will appear in .vuo (Graphviz dot format) files.