Vuo  0.4.7
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
VuoCompilerNode Class Reference

Description

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 nodeInstanceCallbackStart, if the function exists.
 
void generateCallbackUpdateFunctionCall (Module *module, BasicBlock *block)
 Generates a call to nodeInstanceCallbackUpdate, if the function exists.
 
void generateCallbackStopFunctionCall (Module *module, BasicBlock *block)
 Generates a call to nodeInstanceCallbackStop, if the function exists.
 
Value * generatePushedCondition (BasicBlock *block)
 Generates a condition that is true if any of this node's input event ports has been pushed.
 
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.
 
VuoCompilerInstanceDatagetInstanceData (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 prefix for the node's Graphviz identifier, based on its display name.
 
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.
 
- Public Member Functions inherited from VuoBaseDetail< VuoNode >
 VuoBaseDetail (string description, VuoNode *base)
 Creates a VuoNode detail class.
 
VuoNodegetBase (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.
 

Member Function Documentation

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.

Parameters
moduleThe destination LLVM module (i.e., generated code).
void VuoCompilerNode::generateCallbackStartFunctionCall ( Module *  module,
BasicBlock *  block 
)

Generates a call to nodeInstanceCallbackStart, if the function exists.

Parameters
moduleThe destination LLVM module (i.e., generated code).
blockThe LLVM block to which to append the function call.
void VuoCompilerNode::generateCallbackStopFunctionCall ( Module *  module,
BasicBlock *  block 
)

Generates a call to nodeInstanceCallbackStop, if the function exists.

Parameters
moduleThe destination LLVM module (i.e., generated code).
blockThe LLVM block to which to append the function call.
void VuoCompilerNode::generateCallbackUpdateFunctionCall ( Module *  module,
BasicBlock *  block 
)

Generates a call to nodeInstanceCallbackUpdate, if the function exists.

Parameters
moduleThe destination LLVM module (i.e., generated code).
blockThe 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.

Parameters
moduleThe destination LLVM module (i.e., generated code).
functionThe function in which to generate code.
initialBlockThe block to which the function call will be appended.
finalBlockThe block following the function call.
void VuoCompilerNode::generateFinalization ( Module *  module,
BasicBlock *  block,
bool  isInput 
)

Releases all reference-counted port values.

Todo:
release trigger port data
void VuoCompilerNode::generateFiniFunctionCall ( Module *  module,
BasicBlock *  block 
)

Generates a call to nodeInstanceFini and releases the node's instance data.

Assumes the node is stateful.

Parameters
moduleThe destination LLVM module (i.e., generated code).
blockThe 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.

Parameters
moduleThe destination LLVM module (i.e., generated code).
blockThe LLVM block to which to append the function call.
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.

Example:
vuo_math_add_integer__Add2
VuoCompilerInstanceData * VuoCompilerNode::getInstanceData ( void  )

If this node is stateful, returns the instance data.

Otherwise null.


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