Vuo  2.3.2
Static Public Member Functions | List of all members
VuoCompilerCodeGenUtilities Class Reference

Description

Handy methods for generating code.

Definition at line 22 of file VuoCompilerCodeGenUtilities.hh.

Static Public Member Functions

static Value * generateCreateDispatchSemaphore (Module *module, BasicBlock *block, int initialValue=1)
 Generates code that constructs a dispatch_semaphore_t. More...
 
static Value * generateWaitForSemaphore (Module *module, BasicBlock *block, Value *semaphoreValue)
 Generates code that waits for and claims a dispatch_semaphore_t, with a timeout of DISPATCH_TIME_FOREVER. More...
 
static Value * generateWaitForSemaphore (Module *module, BasicBlock *block, AllocaInst *semaphoreVariable)
 Generates code that waits for and claims a dispatch_semaphore_t, with a timeout of DISPATCH_TIME_FOREVER. More...
 
static Value * generateWaitForSemaphore (Module *module, BasicBlock *block, Value *semaphoreValue, Value *timeoutValue)
 Generates code that waits for and possibly claims a dispatch_semaphore_t. More...
 
static Value * generateWaitForSemaphore (Module *module, BasicBlock *block, AllocaInst *semaphoreVariable, Value *timeoutValue)
 Generates code that waits for and possibly claims a dispatch_semaphore_t. More...
 
static void generateSignalForSemaphore (Module *module, BasicBlock *block, Value *semaphoreValue)
 Generates code that signals a dispatch_semaphore_t. More...
 
static void generateSignalForSemaphore (Module *module, BasicBlock *block, AllocaInst *semaphoreVariable)
 Generates code that signals a dispatch_semaphore_t. More...
 
static Value * generateCreateDispatchGroup (Module *module, BasicBlock *block)
 Generates code that constructs a dispatch_group_t. More...
 
static void generateEnterDispatchGroup (Module *module, BasicBlock *block, Value *dispatchGroupValue)
 Generates code that increments the block count of a dispatch_group_t. More...
 
static void generateLeaveDispatchGroup (Module *module, BasicBlock *block, Value *dispatchGroupValue)
 Generates code that decrements the block count of a dispatch_group_t. More...
 
static void generateWaitForDispatchGroup (Module *module, BasicBlock *block, Value *dispatchGroupValue, dispatch_time_t timeout=DISPATCH_TIME_FOREVER)
 Generates code that waits on a dispatch_group_t. More...
 
static Value * generateGetGlobalDispatchQueue (Module *module, BasicBlock *block)
 Generates code that retrieves the global dispatch queue. More...
 
static Value * generateCreateDispatchQueue (Module *module, BasicBlock *block, string dispatchQueueName)
 Generates code that constructs a dispatch_queue_t. More...
 
static void generateAsynchronousSubmissionToDispatchQueue (Module *module, BasicBlock *block, Value *dispatchQueueValue, Function *workerFunction, Value *contextValue)
 Generates code that submits a function for asynchronous execution on a dispatch queue. More...
 
static void generateSynchronousSubmissionToDispatchQueue (Module *module, BasicBlock *block, Value *dispatchQueueValue, Function *workerFunction, Value *contextValue)
 Generates code that submits a function for synchronous execution on a dispatch queue. More...
 
static void generateRetainForDispatchObject (Module *module, BasicBlock *block, Value *dispatchObjectVariable)
 Generates code that retains a dispatch_object_t (dispatch_queue_t, dispatch_group_t, dispatch_semaphore_t, etc.). More...
 
static void generateFinalizationForDispatchObject (Module *module, BasicBlock *block, Value *dispatchObjectVariable)
 Generates code that releases a dispatch_object_t (dispatch_queue_t, dispatch_group_t, dispatch_semaphore_t, etc.). More...
 
static Value * generateCreateDispatchTime (Module *module, BasicBlock *block, Value *deltaValue)
 Generates code that creates a dispatch_time_t by calling dispatch_time_create(DISPATCH_TIME_NOW, ...). More...
 
static Value * generateCreatePortContext (Module *module, BasicBlock *block, VuoCompilerType *dataType, bool isTrigger, std::string triggerQueueName)
 Generates code that allocates a PortContext on the heap and initializes it with default values. More...
 
static void generateSetPortContextEvent (Module *module, BasicBlock *block, Value *portContextValue, Value *eventValue)
 Generates code that sets the event field of a PortContext. More...
 
static void generateSetPortContextData (Module *module, BasicBlock *block, Value *portContextValue, Value *dataValue, VuoCompilerType *dataType)
 Generates code that sets the data field of a PortContext to a heap-allocated copy of dataValue. More...
 
static void generateSetPortContextTriggerFunction (Module *module, BasicBlock *block, Value *portContextValue, Value *triggerFunctionValue)
 Generates code that sets the triggerFunction field of a PortContext. More...
 
static Value * generateGetPortContextEvent (Module *module, BasicBlock *block, Value *portContextValue)
 Generates code that gets the event field of a PortContext. More...
 
static Value * generateGetPortContextDataVariable (Module *module, BasicBlock *block, Value *portContextValue, VuoCompilerType *dataType)
 Generates code that gets the address of the data field of a PortContext. More...
 
static Value * generateGetPortContextDataVariableAsVoidPointer (Module *module, BasicBlock *block, Value *portContextValue)
 Generates code that returns the data field of a PortContext (a void pointer). More...
 
static Value * generateGetPortContextTriggerQueue (Module *module, BasicBlock *block, Value *portContextValue)
 Generates code that gets the triggerQueue field of a PortContext. More...
 
static Value * generateGetPortContextTriggerSemaphore (Module *module, BasicBlock *block, Value *portContextValue)
 Generates code that gets the triggerSemaphore field of a PortContext. More...
 
static Value * generateGetPortContextTriggerFunction (Module *module, BasicBlock *block, Value *portContextValue, FunctionType *functionType)
 Generates code that gets the triggerFunction field of a PortContext. More...
 
static void generateRetainPortContextData (Module *module, BasicBlock *block, Value *portContextValue)
 Generates code that calls vuoRetainPortContextData(). More...
 
static Value * generateCreateNodeContext (Module *module, BasicBlock *block, bool hasInstanceData, bool isComposition, size_t outputEventCount)
 Generates code that allocates a NodeContext on the heap and initializes it with default values. More...
 
static void generateSetNodeContextPortContexts (Module *module, BasicBlock *block, Value *nodeContextValue, vector< Value * > portContextValues)
 Generates code that sets the portContexts and portContextCount fields of a NodeContext. More...
 
static void generateSetNodeContextInstanceData (Module *module, BasicBlock *block, Value *nodeContextValue, Value *instanceDataValue)
 Generates code that sets the instanceData field of a NodeContext (to a heap-allocated copy of instanceDataValue) and frees the old value. More...
 
static void generateSetNodeContextClaimingEventId (Module *module, BasicBlock *block, Value *nodeContextValue, Value *claimingEventIdValue)
 Generates code that sets the claimingEventId field of a NodeContext. More...
 
static void generateSetNodeContextOutputEvent (Module *module, BasicBlock *block, Value *nodeContextValue, size_t index, Value *eventValue)
 Generates code that sets an element of the outputEvents field of a NodeContext. More...
 
static Value * generateGetNodeContextPortContext (Module *module, BasicBlock *block, Value *nodeContextValue, int index)
 Generates code that gets an element of the portContexts field of a NodeContext. More...
 
static Value * generateGetNodeContextInstanceData (Module *module, BasicBlock *block, Value *nodeContextValue, Type *instanceDataType)
 Generates code that gets the instanceData field of a NodeContext (and dereference it to get the actual instance data). More...
 
static Value * generateGetNodeContextInstanceDataVariable (Module *module, BasicBlock *block, Value *nodeContextValue, Type *instanceDataType)
 Generates code that gets the address of the instanceData field of a NodeContext. More...
 
static Value * generateGetNodeContextClaimingEventId (Module *module, BasicBlock *block, Value *nodeContextValue)
 Generates code that gets the claimingEventId field of a NodeContext. More...
 
static Value * generateGetNodeContextExecutingGroup (Module *module, BasicBlock *block, Value *nodeContextValue)
 Generates code that gets the executingGroup field of a NodeContext. More...
 
static Value * generateGetNodeContextOutputEvent (Module *module, BasicBlock *block, Value *nodeContextValue, size_t index)
 Generates code that gets an element of the outputEvents field of a NodeContext. More...
 
static void generateResetNodeContextEvents (Module *module, BasicBlock *block, Value *nodeContextValue)
 Generates code that sets the event field to false for all PortContexts in a NodeContext. More...
 
static void generateStartedExecutingEvent (Module *module, BasicBlock *block, Value *nodeContextValue, Value *eventIdValue)
 Generates a call to vuoStartedExecutingEvent. More...
 
static void generateSpunOffExecutingEvent (Module *module, BasicBlock *block, Value *nodeContextValue, Value *eventIdValue)
 Generates a call to vuoSpunOffExecutingEvent. More...
 
static Value * generateFinishedExecutingEvent (Module *module, BasicBlock *block, Value *nodeContextValue, Value *eventIdValue)
 Generates a call to vuoFinishedExecutingEvent. More...
 
static Value * generateGetOneExecutingEvent (Module *module, BasicBlock *block, Value *nodeContextValue)
 Generates a call to vuoGetOneExecutingEvent. More...
 
static Value * generateCreateCompositionState (Module *module, BasicBlock *block, Value *runtimeStateValue, Value *compositionIdentifierValue)
 Generates code that creates a VuoCompositionState * from the given void *runtimeState and char *compositionIdentifier. More...
 
static Value * generateGetCompositionStateRuntimeState (Module *module, BasicBlock *block, Value *compositionStateValue)
 Generates code that gets the runtimeState field of a VuoCompositionState *. More...
 
static Value * generateGetCompositionStateCompositionIdentifier (Module *module, BasicBlock *block, Value *compositionStateValue)
 Generates code that gets the compositionIdentifier field of a VuoCompositionState *. More...
 
static void generateFreeCompositionState (Module *module, BasicBlock *block, Value *compositionStateValue)
 Generates code that frees a VuoCompositionState * (but not its fields). More...
 
static Value * generateGetDataForPort (Module *module, BasicBlock *block, Value *compositionStateValue, Value *portIdentifierValue)
 Generates code that retrives the data field in a port's context, given the port's identifier. More...
 
static Value * generateGetNodeIndexForPort (Module *module, BasicBlock *block, Value *compositionStateValue, Value *portIdentifierValue)
 Generates code that retrieves the index (in VuoCompilerBitcodeGenerator::orderedNodes) of a node, given the identifier of a port on the node. More...
 
static Value * generateGetTypeIndexForPort (Module *module, BasicBlock *block, Value *compositionStateValue, Value *portIdentifierValue)
 Generates code that retrieves the index (in VuoCompilerBitcodeGenerator::orderedTypes) of a port's type, given the port's identifier. More...
 
static void generateScheduleTriggerWorker (Module *module, BasicBlock *block, Value *queueValue, Value *contextValue, Value *workerFunctionValue, int minThreadsNeeded, int maxThreadsNeeded, Value *eventIdValue, Value *compositionStateValue, int chainCount)
 Generates a call to vuoScheduleTriggerWorker. More...
 
static void generateScheduleChainWorker (Module *module, BasicBlock *block, Value *queueValue, Value *contextValue, Value *workerFunctionValue, int minThreadsNeeded, int maxThreadsNeeded, Value *eventIdValue, Value *compositionStateValue, size_t chainIndex, vector< size_t > upstreamChainIndices)
 Generates a call to vuoScheduleChainWorker. More...
 
static void generateGrantThreadsToChain (Module *module, BasicBlock *block, int minThreadsNeeded, int maxThreadsNeeded, Value *eventIdValue, Value *compositionStateValue, size_t chainIndex)
 Generates a call to vuoGrantThreadsToChain. More...
 
static void generateGrantThreadsToSubcomposition (Module *module, BasicBlock *block, Value *eventIdValue, Value *compositionStateValue, Value *chainIndexValue, Value *subcompositionIdentifierValue)
 Generates a call to vuoGrantThreadsToSubcomposition. More...
 
static void generateReturnThreadsForTriggerWorker (Module *module, BasicBlock *block, Value *eventIdValue, Value *compositionStateValue)
 Generates a call to vuoReturnThreadsForTriggerWorker. More...
 
static void generateReturnThreadsForChainWorker (Module *module, BasicBlock *block, Value *eventIdValue, Value *compositionStateValue, Value *chainIndexValue)
 Generates a call to vuoReturnThreadsForChainWorker. More...
 
static void generateLockNodes (Module *module, BasicBlock *&block, Value *compositionStateValue, const vector< size_t > &nodeIndices, Value *eventIdValue, VuoCompilerConstantsCache *constantsCache)
 Generates a call to vuoLockNodes(). More...
 
static void generateLockNode (Module *module, BasicBlock *&block, Value *compositionStateValue, size_t nodeIndex, Value *eventIdValue)
 Generates a call to vuoLockNode(). More...
 
static void generateLockNode (Module *module, BasicBlock *&block, Value *compositionStateValue, Value *nodeIndexValue, Value *eventIdValue)
 Generates a call to vuoLockNode(). More...
 
static void generateUnlockNodes (Module *module, BasicBlock *block, Value *compositionStateValue, const vector< size_t > &nodeIndices, VuoCompilerConstantsCache *constantsCache)
 Generates a call to vuoUnlockNodes(). More...
 
static void generateUnlockNode (Module *module, BasicBlock *block, Value *compositionStateValue, size_t nodeIndex)
 Generates a call to vuoUnlockNode(). More...
 
static void generateUnlockNode (Module *module, BasicBlock *block, Value *compositionStateValue, Value *nodeIndexValue)
 Generates a call to vuoUnlockNode(). More...
 
static void generateSetArrayElement (Module *module, BasicBlock *block, Value *arrayValue, size_t elementIndex, Value *value)
 Generates code that sets the array element at the given index. More...
 
static Value * generateGetArrayElement (Module *module, BasicBlock *block, Value *arrayValue, size_t elementIndex)
 Generates code that gets the array element at the given index. More...
 
static Value * generateGetArrayElement (Module *module, BasicBlock *block, Value *arrayValue, Value *elementIndexValue)
 Generates code that gets the array element at the given index. More...
 
static void generateSetStructPointerElement (Module *module, BasicBlock *block, Value *structPointer, size_t elementIndex, Value *value)
 Generates code that sets the struct element at the given index. More...
 
static Value * generateGetStructPointerElement (Module *module, BasicBlock *block, Value *structPointer, size_t elementIndex)
 Generates code that gets the struct element at the given index. More...
 
static Value * generatePointerToValue (BasicBlock *block, Value *value)
 Generates code that creates a pointer to value (on the stack), and returns the pointer. More...
 
static Constant * generatePointerToConstantString (Module *module, string stringValue, string globalVariableName="")
 Generates code that creates a global string variable. More...
 
static Constant * generatePointerToConstantArrayOfStrings (Module *module, vector< string > stringValues, string globalVariableName="")
 Generates code that creates a global array-of-strings variable. More...
 
static Constant * generatePointerToConstantArrayOfUnsignedLongs (Module *module, const vector< unsigned long > &values, string globalVariableName="")
 Generates a global array-of-unsigned-longs variable. More...
 
static void generateStringMatchingCode (Module *module, Function *function, BasicBlock *initialBlock, BasicBlock *finalBlock, Value *inputStringValue, map< string, pair< BasicBlock *, BasicBlock * > > blocksForString, VuoCompilerConstantsCache *constantsCache)
 Generates a series of if-else statements for testing if an input string is equal to any of a set of constant strings, and executing the corresponding block of code if it is. More...
 
static void generateIndexMatchingCode (Module *module, Function *function, BasicBlock *initialBlock, BasicBlock *finalBlock, Value *inputIndexValue, vector< pair< BasicBlock *, BasicBlock * > > blocksForIndex)
 Generates a series of if-else statements for testing if an input index is equal to any of a set of indices, and executing the corresponding block of code if it is. More...
 
static Value * generateFormattedString (Module *module, BasicBlock *block, string formatString, vector< Value * > replacementValues, VuoCompilerConstantsCache *constantsCache)
 Generates code that allocates a buffer to hold the composite string, then calls snprintf to combine the format string and replacement values into the composite string. More...
 
static Value * generateStringConcatenation (Module *module, BasicBlock *block, vector< Value * > stringsToConcatenate, VuoCompilerConstantsCache *constantsCache)
 Generates code that allocates a buffer to hold the composite string, then concatenates each member of stringsToConcatenate into the composite string. More...
 
static Value * generateMemoryAllocation (Module *module, BasicBlock *block, Type *elementType, int elementCount)
 Generates code that dynamically allocates memory for an array. More...
 
static Value * generateMemoryAllocation (Module *module, BasicBlock *block, Type *elementType, Value *elementCountValue)
 Generates code that dynamically allocates memory for an array. More...
 
static Value * generateMemoryAllocation (Module *module, BasicBlock *block, size_t bytes)
 Generates code that dynamically allocates a specified amount of memory. More...
 
static void generateMemoryCopy (Module *module, BasicBlock *block, Value *sourceAddress, Value *destAddress, size_t bytes)
 Generates code that copies memory. More...
 
static Value * generateTypeCast (Module *module, BasicBlock *block, Value *valueToCast, Type *typeToCastTo)
 Generates code to cast the value to the desired type (if it doesn't already have that type). More...
 
static void generateAnnotation (Module *module, BasicBlock *block, Value *value, string annotation, string fileName, unsigned int lineNumber, VuoCompilerConstantsCache *constantsCache)
 Generates a call to llvm.var.annotation, which annotates a value with a string. More...
 
static void generateModuleMetadata (Module *module, string metadata, string moduleKey)
 Generates code equivalent to the VuoModuleMetadata macro. More...
 
static void generateRegisterCall (Module *module, BasicBlock *block, Value *argument, Function *freeFunction)
 Generates code to register argument. More...
 
static void generateRetainCall (Module *module, BasicBlock *block, Value *argument)
 Generates any code needed to retain argument. More...
 
static void generateReleaseCall (Module *module, BasicBlock *block, Value *argument)
 Generates any code needed to release argument. More...
 
static void generateRetainOrReleaseCall (Module *module, BasicBlock *block, Value *argument, bool isRetain)
 Generates any code needed to retain or release argument. More...
 
static bool isRetainOrReleaseNeeded (Type *type)
 Returns true if VuoCompilerCodeGenUtilities::generateRetainCall and VuoCompilerCodeGenUtilities::generateReleaseCall would generate any code for type. More...
 
static void generateFreeCall (Module *module, BasicBlock *block, Value *argument)
 Generates a call to free argument (after casting it to a void pointer). More...
 
static void generateJsonObjectPut (Module *module, BasicBlock *block, Value *jsonObjectValue)
 Generates a call to json_object_put(). More...
 
static void generateNullCheck (Module *module, Function *function, Value *valueToCheck, BasicBlock *initialBlock, BasicBlock *&nullBlock, BasicBlock *&notNullBlock)
 Generates code that checks if valueToCheck (assumed to have a pointer type) is null. More...
 
static Value * generateSerialization (Module *module, BasicBlock *block, Value *valueToSerialize, VuoCompilerConstantsCache *constantsCache)
 Generates code that creates a string representation of the given value. More...
 
static void generateUnserialization (Module *module, BasicBlock *block, Value *stringToUnserialize, Value *destinationVariable, VuoCompilerConstantsCache *constantsCache)
 Generates code that creates a value of the given type from the given string representation, and stores it in the destination variable. More...
 
static ICmpInst * generateIsPausedComparison (Module *module, BasicBlock *block, Value *compositionStateValue)
 Generates code that gets the return value of vuoIsPaused() as a comparison value. More...
 
static void generateSendNodeExecutionStarted (Module *module, BasicBlock *block, Value *compositionStateValue, Value *nodeIdentifierValue)
 Generates a call to vuoSendNodeExecutionStarted(). More...
 
static void generateSendNodeExecutionFinished (Module *module, BasicBlock *block, Value *compositionStateValue, Value *nodeIdentifierValue)
 Generates a call to vuoSendNodeExecutionFinished(). More...
 
static void generateSendInputPortsUpdated (Module *module, BasicBlock *block, Value *compositionStateValue, Value *portIdentifierValue, bool receivedEvent, bool receivedData, Value *portDataSummaryValue)
 Generates a call to vuoSendInputPortsUpdated(). More...
 
static void generateSendInputPortsUpdated (Module *module, BasicBlock *block, Value *compositionStateValue, Value *portIdentifierValue, Value *receivedEventValue, Value *receivedDataValue, Value *portDataSummaryValue)
 Generates a call to vuoSendInputPortsUpdated(). More...
 
static void generateSendOutputPortsUpdated (Module *module, BasicBlock *block, Value *compositionStateValue, Value *portIdentifierValue, Value *sentEventValue, Value *sentDataValue, Value *portDataSummaryValue)
 Generates a call to vuoSendOutputPortsUpdated(). More...
 
static void generateSendPublishedOutputPortsUpdated (Module *module, BasicBlock *block, Value *compositionStateValue, Value *portIdentifierValue, Value *sentDataValue, Value *portDataSummaryValue)
 Generates a call to vuoSendPublishedOutputPortsUpdated(). More...
 
static void generateSendEventFinished (Module *module, BasicBlock *block, Value *compositionStateValue, Value *eventIdValue)
 Generates a call to vuoSendEventFinished(). More...
 
static void generateSendEventDropped (Module *module, BasicBlock *block, Value *compositionStateValue, Value *portIdentifierValue)
 Generates a call to vuoSendEventDropped(). More...
 
static ICmpInst * generateShouldSendDataTelemetryComparison (Module *module, BasicBlock *block, string portIdentifier, Value *compositionStateValue, VuoCompilerConstantsCache *constantsCache)
 Generates code that gets the return value of the vuoShouldSendPortDataTelemetry() function as a comparison value. More...
 
static void generateIsNodeBeingRemovedOrReplacedCheck (Module *module, Function *function, string nodeIdentifier, Value *compositionStateValue, BasicBlock *initialBlock, BasicBlock *&trueBlock, BasicBlock *&falseBlock, VuoCompilerConstantsCache *constantsCache, Value *&replacementJsonValue)
 Generates code that checks if vuoIsNodeBeingRemovedOrReplaced() returns true for nodeIdentifier. More...
 
static ICmpInst * generateIsNodeBeingAddedOrReplacedCheck (Module *module, Function *function, string nodeIdentifier, Value *compositionStateValue, BasicBlock *initialBlock, BasicBlock *&trueBlock, BasicBlock *&falseBlock, VuoCompilerConstantsCache *constantsCache, Value *&replacementJsonValue)
 Generates code that checks if vuoIsNodeBeingAddedOrReplaced() returns true for nodeIdentifier. More...
 
static ConstantInt * generateNoEventIdConstant (Module *module)
 Generates a dummy event ID to represent that no event is claiming a node. More...
 
static Value * generateGetNodeContext (Module *module, BasicBlock *block, Value *compositionStateValue, size_t nodeIndex)
 Generates a call to vuoGetNodeContext(). More...
 
static Value * generateGetNodeContext (Module *module, BasicBlock *block, Value *compositionStateValue, Value *nodeIndexValue)
 Generates a call to vuoGetNodeContext(). More...
 
static Value * generateGetCompositionContext (Module *module, BasicBlock *block, Value *compositionStateValue)
 Generates a call to vuoGetCompositionContext(). More...
 
static void generateAddNodeMetadata (Module *module, BasicBlock *block, Value *compositionStateValue, Value *nodeIdentifierValue, Function *compositionCreateContextForNodeFunction, Function *compositionSetPortValueFunction, Function *compositionGetPortValueFunction, Function *compositionFireTriggerPortEventFunction, Function *compositionReleasePortDataFunction)
 Generates a call to vuoAddNodeMetadata(). More...
 
static void generateAddPortMetadata (Module *module, BasicBlock *block, Value *compositionStateValue, Value *portIdentifierValue, Value *portNameValue, size_t typeIndex, Value *initialValueValue)
 Generates a call to vuoAddPortMetadata(). More...
 
static void generateInitContextForTopLevelComposition (Module *module, BasicBlock *block, Value *compositionStateValue, bool isStatefulComposition, size_t publishedOutputPortCount)
 Generates a call to vuoInitContextForTopLevelComposition(). More...
 
static void generateFiniContextForTopLevelComposition (Module *module, BasicBlock *block, Value *compositionStateValue)
 Generates a call to vuoFiniContextForTopLevelComposition(). More...
 
static Value * getTriggerWorkersScheduledValue (Module *module, BasicBlock *block, Value *compositionStateValue)
 Generates a call to vuoGetTriggerWorkersScheduled(). More...
 
static Value * generateGetInputPortString (Module *module, BasicBlock *block, Value *compositionStateValue, Value *portIdentifierValue, Value *interprocessSerializationValue)
 Generates a call to vuoGetInputPortString(). More...
 
static Value * generateGetOutputPortString (Module *module, BasicBlock *block, Value *compositionStateValue, Value *portIdentifierValue, Value *interprocessSerializationValue)
 Generates a call to vuoGetOutputPortString(). More...
 
static Value * generateRuntimeStateValue (Module *module, BasicBlock *block)
 Generates code that gets the value of the vuoRuntimeState global variable. More...
 
static Value * generateGetNextEventId (Module *module, BasicBlock *block, Value *compositionStateValue)
 Generates a call to vuoGetNextEventId(). More...
 
static Value * generateCreateTriggerWorkerContext (Module *module, BasicBlock *block, Value *compositionStateValue, Value *dataCopyValue, Value *eventIdCopyValue)
 Generates a call to vuoCreateTriggerWorkerContext(). More...
 
static void generateFreeTriggerWorkerContext (Module *module, BasicBlock *block, Value *contextValue)
 Generates a call to vuoFreeTriggerWorkerContext(). More...
 
static Value * generateCreatePublishedInputWorkerContext (Module *module, BasicBlock *block, Value *compositionStateValue, Value *inputPortIdentifierValue, Value *valueAsStringValue, Value *isCompositionRunningValue)
 Generates a call to vuoCreatePublishedInputWorkerContext(). More...
 
static void generateAddCompositionStateToThreadLocalStorage (Module *module, BasicBlock *block, Value *compositionStateValue)
 Generates a call to vuoAddCompositionStateToThreadLocalStorage(). More...
 
static void generateRemoveCompositionStateFromThreadLocalStorage (Module *module, BasicBlock *block)
 Generates a call to vuoRemoveCompositionStateFromThreadLocalStorage(). More...
 
static void generatePrint (Module *module, BasicBlock *block, string formatString, Value *value=NULL)
 Generates code that prints to stderr either a string literal or a formatted string with a value. More...
 
static void generatePrint (Module *module, BasicBlock *block, string formatString, const vector< Value * > &values)
 Generates code that prints to stderr either a string literal or a formatted string with a value. More...
 
static bool isPointerToStruct (Type *type, StructType **structType=nullptr)
 Returns true and outputs the struct type if type is a pointer to a struct. More...
 
static Value * callFunctionWithStructReturn (Function *function, vector< Value * > args, BasicBlock *block)
 Generates a call to the function, whose first parameter is assumed to have LLVM's sret attribute. More...
 
static bool isFunctionReturningStructViaParameter (Function *function)
 Returns true if the function's first parameter has LLVM's sret attribute, or in other words, LLVM has transformed struct MyType foo(...) to void foo(struct MyType *, ...). More...
 
static void copyParameterAttributes (Function *srcFunction, Function *dstFunction)
 Adds the LLVM attributes of srcFunction's to the corresponding parameters of dstFunction. More...
 
static void copyParameterAttributes (Module *module, Function *srcFunction, CallInst *dstCall)
 Adds the LLVM attributes of srcFunction's to the corresponding parameters of dstCall. More...
 
static void copyParameterAttributes (Module *module, const AttributeList &srcAttributes, size_t srcStartParam, size_t srcNumParams, Function *dstFunction, size_t dstStartParam)
 Sets the LLVM attributes of dstFunction's parameters to match the corresponding parameters in srcAttributes. More...
 
static void copyParameterAttributes (Module *module, const AttributeList &srcAttributes, size_t srcStartParam, size_t srcNumParams, CallInst *dstCall, size_t dstStartParam)
 Sets the LLVM attributes of dstCall's arguments to match the corresponding parameters in srcAttributes. More...
 
static FunctionType * getFunctionType (Module *module, VuoType *paramType)
 Returns a function type that accepts a vuoType (or its lowered form) as its parameter and has a void return type. More...
 
static Value * getArgumentAtIndex (Function *function, size_t index)
 Returns the argument at index (numbered from 0) in the function's argument list. More...
 
static PointerType * getDispatchSemaphoreType (Module *module)
 Returns a Type reference, generating code for the declaration if needed. More...
 
static PointerType * getDispatchGroupType (Module *module)
 Returns a Type reference, generating code for the declaration if needed. More...
 
static StructType * getDispatchObjectType (Module *module)
 Returns a Type reference, generating code for the declaration if needed. More...
 
static StructType * getNodeContextType (Module *module)
 Returns a Type reference, generating code for the declaration if needed. More...
 
static StructType * getPortContextType (Module *module)
 Returns a Type reference, generating code for the declaration if needed. More...
 
static StructType * getCompositionStateType (Module *module)
 Returns a Type reference, generating code for the declaration if needed. More...
 
static StructType * getJsonObjectType (Module *module)
 Returns a Type reference, generating code for the declaration if needed. More...
 
static PointerType * getCompositionInstanceDataType (Module *module)
 Returns a Type reference, generating code for the declaration if needed. More...
 
static Function * getStrcatFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getStrcmpFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getStrdupFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getStrlenFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getSnprintfFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getSscanfFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getFprintfFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getPutsFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getMallocFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getMemcpyFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getFreeFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getAnnotateFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getJsonObjectPutFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getJsonObjectToJsonStringExtFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getJsonTokenerParseFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getVuoShaderMakeFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getVuoShaderAddSourceFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getVuoShaderSetTransparentFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getVuoShaderSetUniformFunction (Module *module, VuoCompilerType *type)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getVuoSamplerRectCoordinatesFromNormalizedCoordinatesFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getVuoImageGetColorDepthFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getVuoImageRendererRenderFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getCompositionAddNodeMetadataFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getCompositionCreateContextForNodeFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getCompositionPerformDataOnlyTransmissionsFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getCompositionReleasePortDataFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getSetupFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getCleanupFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getInstanceInitFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getInstanceFiniFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getInstanceTriggerStartFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getInstanceTriggerStopFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getNodeInstanceInitFunction (Module *module, string moduleKey, bool isSubcomposition, Type *instanceDataType, const vector< VuoPort * > &modelInputPorts, map< VuoPort *, size_t > &indexOfParameter, VuoCompilerConstantsCache *constantsCache)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getNodeInstanceFiniFunction (Module *module, string moduleKey, Type *instanceDataType, VuoCompilerConstantsCache *constantsCache)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getNodeInstanceTriggerStartFunction (Module *module, string moduleKey, Type *instanceDataType, const vector< VuoPort * > &modelInputPorts, map< VuoPort *, size_t > &indexOfParameter, VuoCompilerConstantsCache *constantsCache)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getNodeInstanceTriggerStopFunction (Module *module, string moduleKey, Type *instanceDataType, VuoCompilerConstantsCache *constantsCache)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getNodeInstanceTriggerUpdateFunction (Module *module, string moduleKey, Type *instanceDataType, const vector< VuoPort * > &modelInputPorts, map< VuoPort *, size_t > &indexOfParameter, VuoCompilerConstantsCache *constantsCache)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getNodeEventFunction (Module *module, string moduleKey, bool isSubcomposition, bool isStateful, Type *instanceDataType, const vector< VuoPort * > &modelInputPorts, const vector< VuoPort * > &modelOutputPorts, const map< VuoPort *, json_object * > &detailsForPorts, const map< VuoPort *, string > &displayNamesForPorts, const map< VuoPort *, string > &defaultValuesForInputPorts, const map< VuoPort *, VuoPortClass::EventBlocking > &eventBlockingForInputPorts, map< VuoPort *, size_t > &indexOfParameter, map< VuoPort *, size_t > &indexOfEventParameter, VuoCompilerConstantsCache *constantsCache)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getCompositionGetPortValueFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getSetInputPortValueFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getCompositionSetPortValueFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getCompositionFireTriggerPortEventFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getGetPublishedInputPortValueFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getGetPublishedOutputPortValueFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getCompositionSetPublishedInputPortValueFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 
static Function * getSetPublishedInputPortValueFunction (Module *module)
 Returns a Function reference, generating code for the declaration if needed. More...
 

Member Function Documentation

◆ callFunctionWithStructReturn()

Value * VuoCompilerCodeGenUtilities::callFunctionWithStructReturn ( Function *  function,
vector< Value * >  args,
BasicBlock *  block 
)
static

Generates a call to the function, whose first parameter is assumed to have LLVM's sret attribute.

Definition at line 5040 of file VuoCompilerCodeGenUtilities.cc.

◆ copyParameterAttributes() [1/4]

void VuoCompilerCodeGenUtilities::copyParameterAttributes ( Function *  srcFunction,
Function *  dstFunction 
)
static

Adds the LLVM attributes of srcFunction's to the corresponding parameters of dstFunction.

Definition at line 5064 of file VuoCompilerCodeGenUtilities.cc.

◆ copyParameterAttributes() [2/4]

void VuoCompilerCodeGenUtilities::copyParameterAttributes ( Module *  module,
const AttributeList &  srcAttributes,
size_t  srcStartParam,
size_t  srcNumParams,
CallInst *  dstCall,
size_t  dstStartParam 
)
static

Sets the LLVM attributes of dstCall's arguments to match the corresponding parameters in srcAttributes.

Definition at line 5099 of file VuoCompilerCodeGenUtilities.cc.

◆ copyParameterAttributes() [3/4]

void VuoCompilerCodeGenUtilities::copyParameterAttributes ( Module *  module,
const AttributeList &  srcAttributes,
size_t  srcStartParam,
size_t  srcNumParams,
Function *  dstFunction,
size_t  dstStartParam 
)
static

Sets the LLVM attributes of dstFunction's parameters to match the corresponding parameters in srcAttributes.

Definition at line 5082 of file VuoCompilerCodeGenUtilities.cc.

◆ copyParameterAttributes() [4/4]

void VuoCompilerCodeGenUtilities::copyParameterAttributes ( Module *  module,
Function *  srcFunction,
CallInst *  dstCall 
)
static

Adds the LLVM attributes of srcFunction's to the corresponding parameters of dstCall.

Definition at line 5074 of file VuoCompilerCodeGenUtilities.cc.

◆ generateAddCompositionStateToThreadLocalStorage()

void VuoCompilerCodeGenUtilities::generateAddCompositionStateToThreadLocalStorage ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue 
)
static

Generates a call to vuoAddCompositionStateToThreadLocalStorage().

Definition at line 3603 of file VuoCompilerCodeGenUtilities.cc.

◆ generateAddNodeMetadata()

void VuoCompilerCodeGenUtilities::generateAddNodeMetadata ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  nodeIdentifierValue,
Function *  compositionCreateContextForNodeFunction,
Function *  compositionSetPortValueFunction,
Function *  compositionGetPortValueFunction,
Function *  compositionFireTriggerPortEventFunction,
Function *  compositionReleasePortDataFunction 
)
static

Generates a call to vuoAddNodeMetadata().

Definition at line 3262 of file VuoCompilerCodeGenUtilities.cc.

◆ generateAddPortMetadata()

void VuoCompilerCodeGenUtilities::generateAddPortMetadata ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  portIdentifierValue,
Value *  portNameValue,
size_t  typeIndex,
Value *  initialValueValue 
)
static

Generates a call to vuoAddPortMetadata().

Definition at line 3307 of file VuoCompilerCodeGenUtilities.cc.

◆ generateAnnotation()

void VuoCompilerCodeGenUtilities::generateAnnotation ( Module *  module,
BasicBlock *  block,
Value *  value,
string  annotation,
string  fileName,
unsigned int  lineNumber,
VuoCompilerConstantsCache constantsCache 
)
static

Generates a call to llvm.var.annotation, which annotates a value with a string.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
valueThe value to be annotated.
annotationThe annotation to be associated with the value.
fileNameThe name of the file for the module (or an empty string if no file).
lineNumberThe line number in the file for the module (or 0 if no file).
constantsCacheThe cache of LLVM constants used to generate string values.

Definition at line 2427 of file VuoCompilerCodeGenUtilities.cc.

◆ generateAsynchronousSubmissionToDispatchQueue()

void VuoCompilerCodeGenUtilities::generateAsynchronousSubmissionToDispatchQueue ( Module *  module,
BasicBlock *  block,
Value *  dispatchQueueValue,
Function *  workerFunction,
Value *  contextValue 
)
static

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

Definition at line 342 of file VuoCompilerCodeGenUtilities.cc.

◆ generateCreateCompositionState()

Value * VuoCompilerCodeGenUtilities::generateCreateCompositionState ( Module *  module,
BasicBlock *  block,
Value *  runtimeStateValue,
Value *  compositionIdentifierValue 
)
static

Generates code that creates a VuoCompositionState * from the given void *runtimeState and char *compositionIdentifier.

Definition at line 1322 of file VuoCompilerCodeGenUtilities.cc.

◆ generateCreateDispatchGroup()

Value * VuoCompilerCodeGenUtilities::generateCreateDispatchGroup ( Module *  module,
BasicBlock *  block 
)
static

Generates code that constructs a dispatch_group_t.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
Returns
The return value of dispatch_group_create().

Definition at line 160 of file VuoCompilerCodeGenUtilities.cc.

◆ generateCreateDispatchQueue()

Value * VuoCompilerCodeGenUtilities::generateCreateDispatchQueue ( Module *  module,
BasicBlock *  block,
string  dispatchQueueName 
)
static

Generates code that constructs a dispatch_queue_t.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
dispatchQueueNameThe argument to pass to dispatch_queue_create().
Returns
The return value of dispatch_queue_create().

Definition at line 289 of file VuoCompilerCodeGenUtilities.cc.

◆ generateCreateDispatchSemaphore()

Value * VuoCompilerCodeGenUtilities::generateCreateDispatchSemaphore ( Module *  module,
BasicBlock *  block,
int  initialValue = 1 
)
static

Generates code that constructs a dispatch_semaphore_t.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
initialValueThe argument to pass to dispatch_semaphore_create().
Returns
The return value of dispatch_semaphore_create().

Definition at line 30 of file VuoCompilerCodeGenUtilities.cc.

◆ generateCreateDispatchTime()

Value * VuoCompilerCodeGenUtilities::generateCreateDispatchTime ( Module *  module,
BasicBlock *  block,
Value *  deltaValue 
)
static

Generates code that creates a dispatch_time_t by calling dispatch_time_create(DISPATCH_TIME_NOW, ...).

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
deltaValueThe 2nd argument to dispatch_time_create.
Returns
The created dispatch_time_t.

Definition at line 496 of file VuoCompilerCodeGenUtilities.cc.

◆ generateCreateNodeContext()

Value * VuoCompilerCodeGenUtilities::generateCreateNodeContext ( Module *  module,
BasicBlock *  block,
bool  hasInstanceData,
bool  isComposition,
size_t  outputEventCount 
)
static

Generates code that allocates a NodeContext on the heap and initializes it with default values.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
hasInstanceDataWhether this node has instance data.
isCompositionWhether this node is a subcomposition.
outputEventCountThe number of output ports, used to create the outputEvents field for subcompositions.
Returns
A value of type NodeContext *.

Definition at line 831 of file VuoCompilerCodeGenUtilities.cc.

◆ generateCreatePortContext()

Value * VuoCompilerCodeGenUtilities::generateCreatePortContext ( Module *  module,
BasicBlock *  block,
VuoCompilerType dataType,
bool  isTrigger,
std::string  triggerQueueName 
)
static

Generates code that allocates a PortContext on the heap and initializes it with default values.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
dataTypeThe type of the port's data, or null if the port is event-only.
isTriggerWhether the port is a trigger.
triggerQueueNameIf the port is a trigger, the name to use when creating its dispatch queue.
Returns
A value of type PortContext *.

Definition at line 533 of file VuoCompilerCodeGenUtilities.cc.

◆ generateCreatePublishedInputWorkerContext()

Value * VuoCompilerCodeGenUtilities::generateCreatePublishedInputWorkerContext ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  inputPortIdentifierValue,
Value *  valueAsStringValue,
Value *  isCompositionRunningValue 
)
static

Generates a call to vuoCreatePublishedInputWorkerContext().

Definition at line 3570 of file VuoCompilerCodeGenUtilities.cc.

◆ generateCreateTriggerWorkerContext()

Value * VuoCompilerCodeGenUtilities::generateCreateTriggerWorkerContext ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  dataCopyValue,
Value *  eventIdCopyValue 
)
static

Generates a call to vuoCreateTriggerWorkerContext().

Definition at line 3518 of file VuoCompilerCodeGenUtilities.cc.

◆ generateEnterDispatchGroup()

void VuoCompilerCodeGenUtilities::generateEnterDispatchGroup ( Module *  module,
BasicBlock *  block,
Value *  dispatchGroupValue 
)
static

Generates code that increments the block count of a dispatch_group_t.

Definition at line 180 of file VuoCompilerCodeGenUtilities.cc.

◆ generateFinalizationForDispatchObject()

void VuoCompilerCodeGenUtilities::generateFinalizationForDispatchObject ( Module *  module,
BasicBlock *  block,
Value *  dispatchObjectVariable 
)
static

Generates code that releases a dispatch_object_t (dispatch_queue_t, dispatch_group_t, dispatch_semaphore_t, etc.).

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
dispatchObjectVariableA pointer to the dispatch_object_t (e.g. a GlobalVariable or AllocaInst).

Definition at line 471 of file VuoCompilerCodeGenUtilities.cc.

◆ generateFiniContextForTopLevelComposition()

void VuoCompilerCodeGenUtilities::generateFiniContextForTopLevelComposition ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue 
)
static

Generates a call to vuoFiniContextForTopLevelComposition().

Definition at line 3376 of file VuoCompilerCodeGenUtilities.cc.

◆ generateFinishedExecutingEvent()

Value * VuoCompilerCodeGenUtilities::generateFinishedExecutingEvent ( Module *  module,
BasicBlock *  block,
Value *  nodeContextValue,
Value *  eventIdValue 
)
static

Generates a call to vuoFinishedExecutingEvent.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
nodeContextValueThe composition's node context, a value of type NodeContext *.
eventIdValueA value of type unsigned long.
Returns
A value of type bool.

Definition at line 1266 of file VuoCompilerCodeGenUtilities.cc.

◆ generateFormattedString()

Value * VuoCompilerCodeGenUtilities::generateFormattedString ( Module *  module,
BasicBlock *  block,
string  formatString,
vector< Value * >  replacementValues,
VuoCompilerConstantsCache constantsCache 
)
static

Generates code that allocates a buffer to hold the composite string, then calls snprintf to combine the format string and replacement values into the composite string.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
formatStringThe format string to be passed to snprintf.
replacementValuesThe replacement values to be passed to snprintf.
constantsCacheThe cache of LLVM constants used to generate string values.
Returns
A value containing the address of the composite string.

Definition at line 2172 of file VuoCompilerCodeGenUtilities.cc.

◆ generateFreeCall()

void VuoCompilerCodeGenUtilities::generateFreeCall ( Module *  module,
BasicBlock *  block,
Value *  argument 
)
static

Generates a call to free argument (after casting it to a void pointer).

Definition at line 2745 of file VuoCompilerCodeGenUtilities.cc.

◆ generateFreeCompositionState()

void VuoCompilerCodeGenUtilities::generateFreeCompositionState ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue 
)
static

Generates code that frees a VuoCompositionState * (but not its fields).

Definition at line 1397 of file VuoCompilerCodeGenUtilities.cc.

◆ generateFreeTriggerWorkerContext()

void VuoCompilerCodeGenUtilities::generateFreeTriggerWorkerContext ( Module *  module,
BasicBlock *  block,
Value *  contextValue 
)
static

Generates a call to vuoFreeTriggerWorkerContext().

Definition at line 3548 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetArrayElement() [1/2]

Value * VuoCompilerCodeGenUtilities::generateGetArrayElement ( Module *  module,
BasicBlock *  block,
Value *  arrayValue,
size_t  elementIndex 
)
static

Generates code that gets the array element at the given index.

Definition at line 1895 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetArrayElement() [2/2]

Value * VuoCompilerCodeGenUtilities::generateGetArrayElement ( Module *  module,
BasicBlock *  block,
Value *  arrayValue,
Value *  elementIndexValue 
)
static

Generates code that gets the array element at the given index.

Definition at line 1904 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetCompositionContext()

Value * VuoCompilerCodeGenUtilities::generateGetCompositionContext ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue 
)
static

Generates a call to vuoGetCompositionContext().

Definition at line 3239 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetCompositionStateCompositionIdentifier()

Value * VuoCompilerCodeGenUtilities::generateGetCompositionStateCompositionIdentifier ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue 
)
static

Generates code that gets the compositionIdentifier field of a VuoCompositionState *.

Definition at line 1373 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetCompositionStateRuntimeState()

Value * VuoCompilerCodeGenUtilities::generateGetCompositionStateRuntimeState ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue 
)
static

Generates code that gets the runtimeState field of a VuoCompositionState *.

Definition at line 1349 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetDataForPort()

Value * VuoCompilerCodeGenUtilities::generateGetDataForPort ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  portIdentifierValue 
)
static

Generates code that retrives the data field in a port's context, given the port's identifier.

Definition at line 1420 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetGlobalDispatchQueue()

Value * VuoCompilerCodeGenUtilities::generateGetGlobalDispatchQueue ( Module *  module,
BasicBlock *  block 
)
static

Generates code that retrieves the global dispatch queue.

Definition at line 254 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetInputPortString()

Value * VuoCompilerCodeGenUtilities::generateGetInputPortString ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  portIdentifierValue,
Value *  interprocessSerializationValue 
)
static

Generates a call to vuoGetInputPortString().

Definition at line 3421 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetNextEventId()

Value * VuoCompilerCodeGenUtilities::generateGetNextEventId ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue 
)
static

Generates a call to vuoGetNextEventId().

Definition at line 3495 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetNodeContext() [1/2]

Value * VuoCompilerCodeGenUtilities::generateGetNodeContext ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
size_t  nodeIndex 
)
static

Generates a call to vuoGetNodeContext().

Definition at line 3202 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetNodeContext() [2/2]

Value * VuoCompilerCodeGenUtilities::generateGetNodeContext ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  nodeIndexValue 
)
static

Generates a call to vuoGetNodeContext().

Definition at line 3213 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetNodeContextClaimingEventId()

Value * VuoCompilerCodeGenUtilities::generateGetNodeContextClaimingEventId ( Module *  module,
BasicBlock *  block,
Value *  nodeContextValue 
)
static

Generates code that gets the claimingEventId field of a NodeContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
nodeContextValueA value of type NodeContext *.
Returns
The value of the field.

Definition at line 1090 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetNodeContextExecutingGroup()

Value * VuoCompilerCodeGenUtilities::generateGetNodeContextExecutingGroup ( Module *  module,
BasicBlock *  block,
Value *  nodeContextValue 
)
static

Generates code that gets the executingGroup field of a NodeContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
nodeContextValueA value of type NodeContext *.
Returns
The value of the field.

Definition at line 1115 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetNodeContextInstanceData()

Value * VuoCompilerCodeGenUtilities::generateGetNodeContextInstanceData ( Module *  module,
BasicBlock *  block,
Value *  nodeContextValue,
Type *  instanceDataType 
)
static

Generates code that gets the instanceData field of a NodeContext (and dereference it to get the actual instance data).

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
nodeContextValueA value of type NodeContext *.
instanceDataTypeThe type that the instanceData field should be converted to before returning.
Returns
The value of the field.

Definition at line 1049 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetNodeContextInstanceDataVariable()

Value * VuoCompilerCodeGenUtilities::generateGetNodeContextInstanceDataVariable ( Module *  module,
BasicBlock *  block,
Value *  nodeContextValue,
Type *  instanceDataType 
)
static

Generates code that gets the address of the instanceData field of a NodeContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
nodeContextValueA value of type NodeContext *.
instanceDataTypeThe type that the instanceData field should be converted to before returning.
Returns
The value of the field.

Definition at line 1064 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetNodeContextOutputEvent()

Value * VuoCompilerCodeGenUtilities::generateGetNodeContextOutputEvent ( Module *  module,
BasicBlock *  block,
Value *  nodeContextValue,
size_t  index 
)
static

Generates code that gets an element of the outputEvents field of a NodeContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
nodeContextValueA value of type NodeContext *.
indexThe index of the event in the node context's array of output events.
Returns
The value of the field.

Definition at line 1141 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetNodeContextPortContext()

Value * VuoCompilerCodeGenUtilities::generateGetNodeContextPortContext ( Module *  module,
BasicBlock *  block,
Value *  nodeContextValue,
int  index 
)
static

Generates code that gets an element of the portContexts field of a NodeContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
nodeContextValueA value of type NodeContext *.
indexThe index of the port context in the node context's array of port contexts.
Returns
The value of the field.

Definition at line 1013 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetNodeIndexForPort()

Value * VuoCompilerCodeGenUtilities::generateGetNodeIndexForPort ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  portIdentifierValue 
)
static

Generates code that retrieves the index (in VuoCompilerBitcodeGenerator::orderedNodes) of a node, given the identifier of a port on the node.

Definition at line 1447 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetOneExecutingEvent()

Value * VuoCompilerCodeGenUtilities::generateGetOneExecutingEvent ( Module *  module,
BasicBlock *  block,
Value *  nodeContextValue 
)
static

Generates a call to vuoGetOneExecutingEvent.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
nodeContextValueThe composition's node context, a value of type NodeContext *.
Returns
A value of type unsigned long.

Definition at line 1298 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetOutputPortString()

Value * VuoCompilerCodeGenUtilities::generateGetOutputPortString ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  portIdentifierValue,
Value *  interprocessSerializationValue 
)
static

Generates a call to vuoGetOutputPortString().

Definition at line 3450 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetPortContextDataVariable()

Value * VuoCompilerCodeGenUtilities::generateGetPortContextDataVariable ( Module *  module,
BasicBlock *  block,
Value *  portContextValue,
VuoCompilerType dataType 
)
static

Generates code that gets the address of the data field of a PortContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
portContextValueA value of type PortContext *.
dataTypeThe type that the data should be converted to before returning.
Returns
The value of the field.

Definition at line 685 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetPortContextDataVariableAsVoidPointer()

Value * VuoCompilerCodeGenUtilities::generateGetPortContextDataVariableAsVoidPointer ( Module *  module,
BasicBlock *  block,
Value *  portContextValue 
)
static

Generates code that returns the data field of a PortContext (a void pointer).

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
portContextValueA value of type PortContext *.
Returns
The value of the field.

Definition at line 699 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetPortContextEvent()

Value * VuoCompilerCodeGenUtilities::generateGetPortContextEvent ( Module *  module,
BasicBlock *  block,
Value *  portContextValue 
)
static

Generates code that gets the event field of a PortContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
portContextValueA value of type PortContext *.
Returns
The value of the field.

Definition at line 659 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetPortContextTriggerFunction()

Value * VuoCompilerCodeGenUtilities::generateGetPortContextTriggerFunction ( Module *  module,
BasicBlock *  block,
Value *  portContextValue,
FunctionType *  functionType 
)
static

Generates code that gets the triggerFunction field of a PortContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
portContextValueA value of type PortContext *.
functionTypeThe type that the function value should be converted to before returning.
Returns
The value of the field.

Definition at line 775 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetPortContextTriggerQueue()

Value * VuoCompilerCodeGenUtilities::generateGetPortContextTriggerQueue ( Module *  module,
BasicBlock *  block,
Value *  portContextValue 
)
static

Generates code that gets the triggerQueue field of a PortContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
portContextValueA value of type PortContext *.
Returns
The value of the field.

Definition at line 724 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetPortContextTriggerSemaphore()

Value * VuoCompilerCodeGenUtilities::generateGetPortContextTriggerSemaphore ( Module *  module,
BasicBlock *  block,
Value *  portContextValue 
)
static

Generates code that gets the triggerSemaphore field of a PortContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
portContextValueA value of type PortContext *.
Returns
The value of the field.

Definition at line 749 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetStructPointerElement()

Value * VuoCompilerCodeGenUtilities::generateGetStructPointerElement ( Module *  module,
BasicBlock *  block,
Value *  structPointer,
size_t  elementIndex 
)
static

Generates code that gets the struct element at the given index.

Definition at line 1939 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGetTypeIndexForPort()

Value * VuoCompilerCodeGenUtilities::generateGetTypeIndexForPort ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  portIdentifierValue 
)
static

Generates code that retrieves the index (in VuoCompilerBitcodeGenerator::orderedTypes) of a port's type, given the port's identifier.

Definition at line 1474 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGrantThreadsToChain()

void VuoCompilerCodeGenUtilities::generateGrantThreadsToChain ( Module *  module,
BasicBlock *  block,
int  minThreadsNeeded,
int  maxThreadsNeeded,
Value *  eventIdValue,
Value *  compositionStateValue,
size_t  chainIndex 
)
static

Generates a call to vuoGrantThreadsToChain.

Definition at line 1614 of file VuoCompilerCodeGenUtilities.cc.

◆ generateGrantThreadsToSubcomposition()

void VuoCompilerCodeGenUtilities::generateGrantThreadsToSubcomposition ( Module *  module,
BasicBlock *  block,
Value *  eventIdValue,
Value *  compositionStateValue,
Value *  chainIndexValue,
Value *  subcompositionIdentifierValue 
)
static

Generates a call to vuoGrantThreadsToSubcomposition.

Definition at line 1653 of file VuoCompilerCodeGenUtilities.cc.

◆ generateIndexMatchingCode()

void VuoCompilerCodeGenUtilities::generateIndexMatchingCode ( Module *  module,
Function *  function,
BasicBlock *  initialBlock,
BasicBlock *  finalBlock,
Value *  inputIndexValue,
vector< pair< BasicBlock *, BasicBlock * > >  blocksForIndex 
)
static

Generates a series of if-else statements for testing if an input index is equal to any of a set of indices, and executing the corresponding block of code if it is.

Assumes that none of the blocks passed to this function contain branch instructions. (This function appends branch instructions to all but the final block.)

Example:

if (inputIndex == 0) // blockForIndex[0] else if (inputIndex == 1) // blockForIndex[1] ...

Parameters
moduleThe module in which to generate code.
functionThe function in which to generate code.
initialBlockThe block to which the first if-statement will be appended.
finalBlockThe block following the if-else statements.
inputIndexValueThe index to compare in each if-statement.
blocksForIndexFor each index, the first block and last block to execute if the input index matches that index. The caller is responsible for branching (directly or indirectly) from the first to the last block.

Definition at line 2137 of file VuoCompilerCodeGenUtilities.cc.

◆ generateInitContextForTopLevelComposition()

void VuoCompilerCodeGenUtilities::generateInitContextForTopLevelComposition ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
bool  isStatefulComposition,
size_t  publishedOutputPortCount 
)
static

Generates a call to vuoInitContextForTopLevelComposition().

Definition at line 3343 of file VuoCompilerCodeGenUtilities.cc.

◆ generateIsNodeBeingAddedOrReplacedCheck()

ICmpInst * VuoCompilerCodeGenUtilities::generateIsNodeBeingAddedOrReplacedCheck ( Module *  module,
Function *  function,
string  nodeIdentifier,
Value *  compositionStateValue,
BasicBlock *  initialBlock,
BasicBlock *&  trueBlock,
BasicBlock *&  falseBlock,
VuoCompilerConstantsCache constantsCache,
Value *&  replacementJsonValue 
)
static

Generates code that checks if vuoIsNodeBeingAddedOrReplaced() returns true for nodeIdentifier.

This function initializes trueBlock and falseBlock and sets them up to be the blocks executed depending on the return value.

Definition at line 3145 of file VuoCompilerCodeGenUtilities.cc.

◆ generateIsNodeBeingRemovedOrReplacedCheck()

void VuoCompilerCodeGenUtilities::generateIsNodeBeingRemovedOrReplacedCheck ( Module *  module,
Function *  function,
string  nodeIdentifier,
Value *  compositionStateValue,
BasicBlock *  initialBlock,
BasicBlock *&  trueBlock,
BasicBlock *&  falseBlock,
VuoCompilerConstantsCache constantsCache,
Value *&  replacementJsonValue 
)
static

Generates code that checks if vuoIsNodeBeingRemovedOrReplaced() returns true for nodeIdentifier.

This function initializes trueBlock and falseBlock and sets them up to be the blocks executed depending on the return value.

Definition at line 3097 of file VuoCompilerCodeGenUtilities.cc.

◆ generateIsPausedComparison()

ICmpInst * VuoCompilerCodeGenUtilities::generateIsPausedComparison ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue 
)
static

Generates code that gets the return value of vuoIsPaused() as a comparison value.

Definition at line 2824 of file VuoCompilerCodeGenUtilities.cc.

◆ generateJsonObjectPut()

void VuoCompilerCodeGenUtilities::generateJsonObjectPut ( Module *  module,
BasicBlock *  block,
Value *  jsonObjectValue 
)
static

Generates a call to json_object_put().

Definition at line 2756 of file VuoCompilerCodeGenUtilities.cc.

◆ generateLeaveDispatchGroup()

void VuoCompilerCodeGenUtilities::generateLeaveDispatchGroup ( Module *  module,
BasicBlock *  block,
Value *  dispatchGroupValue 
)
static

Generates code that decrements the block count of a dispatch_group_t.

Definition at line 201 of file VuoCompilerCodeGenUtilities.cc.

◆ generateLockNode() [1/2]

void VuoCompilerCodeGenUtilities::generateLockNode ( Module *  module,
BasicBlock *&  block,
Value *  compositionStateValue,
size_t  nodeIndex,
Value *  eventIdValue 
)
static

Generates a call to vuoLockNode().

Definition at line 1776 of file VuoCompilerCodeGenUtilities.cc.

◆ generateLockNode() [2/2]

void VuoCompilerCodeGenUtilities::generateLockNode ( Module *  module,
BasicBlock *&  block,
Value *  compositionStateValue,
Value *  nodeIndexValue,
Value *  eventIdValue 
)
static

Generates a call to vuoLockNode().

Definition at line 1786 of file VuoCompilerCodeGenUtilities.cc.

◆ generateLockNodes()

void VuoCompilerCodeGenUtilities::generateLockNodes ( Module *  module,
BasicBlock *&  block,
Value *  compositionStateValue,
const vector< size_t > &  nodeIndices,
Value *  eventIdValue,
VuoCompilerConstantsCache constantsCache 
)
static

Generates a call to vuoLockNodes().

Definition at line 1740 of file VuoCompilerCodeGenUtilities.cc.

◆ generateMemoryAllocation() [1/3]

Value * VuoCompilerCodeGenUtilities::generateMemoryAllocation ( Module *  module,
BasicBlock *  block,
size_t  bytes 
)
static

Generates code that dynamically allocates a specified amount of memory.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
bytesThe number of bytes to allocate.
Returns
A value pointing to the address of the memory.

Definition at line 2349 of file VuoCompilerCodeGenUtilities.cc.

◆ generateMemoryAllocation() [2/3]

Value * VuoCompilerCodeGenUtilities::generateMemoryAllocation ( Module *  module,
BasicBlock *  block,
Type *  elementType,
int  elementCount 
)
static

Generates code that dynamically allocates memory for an array.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
elementTypeThe type of each array element.
elementCountThe number of array elements.
Returns
A value pointing to the address of the memory.

Definition at line 2306 of file VuoCompilerCodeGenUtilities.cc.

◆ generateMemoryAllocation() [3/3]

Value * VuoCompilerCodeGenUtilities::generateMemoryAllocation ( Module *  module,
BasicBlock *  block,
Type *  elementType,
Value *  elementCountValue 
)
static

Generates code that dynamically allocates memory for an array.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
elementTypeThe type of each array element.
elementCountValueThe number of array elements. Assumed to have type integer.
Returns
A value pointing to the address of the memory.

Definition at line 2321 of file VuoCompilerCodeGenUtilities.cc.

◆ generateMemoryCopy()

void VuoCompilerCodeGenUtilities::generateMemoryCopy ( Module *  module,
BasicBlock *  block,
Value *  sourceAddress,
Value *  destAddress,
size_t  bytes 
)
static

Generates code that copies memory.

Beware: this function's arguments are ordered {source, dest}, which is different from the libc's memcpy(void *restrict dst, const void *restrict src, size_t n);.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
sourceAddressThe type of each array element.
destAddressThe number of array elements. Assumed to have type integer.
bytesThe number of array elements. Assumed to have type integer.

Definition at line 2369 of file VuoCompilerCodeGenUtilities.cc.

◆ generateModuleMetadata()

void VuoCompilerCodeGenUtilities::generateModuleMetadata ( Module *  module,
string  metadata,
string  moduleKey 
)
static

Generates code equivalent to the VuoModuleMetadata macro.

Definition at line 2462 of file VuoCompilerCodeGenUtilities.cc.

◆ generateNoEventIdConstant()

ConstantInt * VuoCompilerCodeGenUtilities::generateNoEventIdConstant ( Module *  module)
static

Generates a dummy event ID to represent that no event is claiming a node.

Definition at line 3194 of file VuoCompilerCodeGenUtilities.cc.

◆ generateNullCheck()

void VuoCompilerCodeGenUtilities::generateNullCheck ( Module *  module,
Function *  function,
Value *  valueToCheck,
BasicBlock *  initialBlock,
BasicBlock *&  nullBlock,
BasicBlock *&  notNullBlock 
)
static

Generates code that checks if valueToCheck (assumed to have a pointer type) is null.

This function initializes nullBlock and notNullBlock and sets them up to be the blocks executed depending on the result.

Definition at line 2766 of file VuoCompilerCodeGenUtilities.cc.

◆ generatePointerToConstantArrayOfStrings()

Constant * VuoCompilerCodeGenUtilities::generatePointerToConstantArrayOfStrings ( Module *  module,
vector< string >  stringValues,
string  globalVariableName = "" 
)
static

Generates code that creates a global array-of-strings variable.

Parameters
moduleThe module in which to generate code.
stringValuesThe strings to be placed in the array.
globalVariableNameThe name to give to the global variable.
Returns
The address of the array.

Definition at line 2002 of file VuoCompilerCodeGenUtilities.cc.

◆ generatePointerToConstantArrayOfUnsignedLongs()

Constant * VuoCompilerCodeGenUtilities::generatePointerToConstantArrayOfUnsignedLongs ( Module *  module,
const vector< unsigned long > &  values,
string  globalVariableName = "" 
)
static

Generates a global array-of-unsigned-longs variable.

Parameters
moduleThe module in which to generate code.
valuesThe values to be placed in the array.
globalVariableNameThe name to give to the global variable.
Returns
The address of the array.

Definition at line 2033 of file VuoCompilerCodeGenUtilities.cc.

◆ generatePointerToConstantString()

Constant * VuoCompilerCodeGenUtilities::generatePointerToConstantString ( Module *  module,
string  stringValue,
string  globalVariableName = "" 
)
static

Generates code that creates a global string variable.

Parameters
moduleThe module in which to generate code.
stringValueThe string initializer for the global variable.
globalVariableNameThe name to give to the global variable.
Returns
The address of the string.

Definition at line 1977 of file VuoCompilerCodeGenUtilities.cc.

◆ generatePointerToValue()

Value * VuoCompilerCodeGenUtilities::generatePointerToValue ( BasicBlock *  block,
Value *  value 
)
static

Generates code that creates a pointer to value (on the stack), and returns the pointer.

Definition at line 1962 of file VuoCompilerCodeGenUtilities.cc.

◆ generatePrint() [1/2]

void VuoCompilerCodeGenUtilities::generatePrint ( Module *  module,
BasicBlock *  block,
string  formatString,
const vector< Value * > &  values 
)
static

Generates code that prints to stderr either a string literal or a formatted string with a value.

(Useful for debugging.)

Definition at line 3670 of file VuoCompilerCodeGenUtilities.cc.

◆ generatePrint() [2/2]

void VuoCompilerCodeGenUtilities::generatePrint ( Module *  module,
BasicBlock *  block,
string  formatString,
Value *  value = NULL 
)
static

Generates code that prints to stderr either a string literal or a formatted string with a value.

(Useful for debugging.)

Definition at line 3659 of file VuoCompilerCodeGenUtilities.cc.

◆ generateRegisterCall()

void VuoCompilerCodeGenUtilities::generateRegisterCall ( Module *  module,
BasicBlock *  block,
Value *  argument,
Function *  freeFunction 
)
static

Generates code to register argument.

Definition at line 2657 of file VuoCompilerCodeGenUtilities.cc.

◆ generateReleaseCall()

void VuoCompilerCodeGenUtilities::generateReleaseCall ( Module *  module,
BasicBlock *  block,
Value *  argument 
)
static

Generates any code needed to release argument.

Definition at line 2694 of file VuoCompilerCodeGenUtilities.cc.

◆ generateRemoveCompositionStateFromThreadLocalStorage()

void VuoCompilerCodeGenUtilities::generateRemoveCompositionStateFromThreadLocalStorage ( Module *  module,
BasicBlock *  block 
)
static

◆ generateResetNodeContextEvents()

void VuoCompilerCodeGenUtilities::generateResetNodeContextEvents ( Module *  module,
BasicBlock *  block,
Value *  nodeContextValue 
)
static

Generates code that sets the event field to false for all PortContexts in a NodeContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
nodeContextValueA value of type NodeContext *.

Definition at line 1175 of file VuoCompilerCodeGenUtilities.cc.

◆ generateRetainCall()

void VuoCompilerCodeGenUtilities::generateRetainCall ( Module *  module,
BasicBlock *  block,
Value *  argument 
)
static

Generates any code needed to retain argument.

Definition at line 2686 of file VuoCompilerCodeGenUtilities.cc.

◆ generateRetainForDispatchObject()

void VuoCompilerCodeGenUtilities::generateRetainForDispatchObject ( Module *  module,
BasicBlock *  block,
Value *  dispatchObjectVariable 
)
static

Generates code that retains a dispatch_object_t (dispatch_queue_t, dispatch_group_t, dispatch_semaphore_t, etc.).

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
dispatchObjectVariableA pointer to the dispatch_object_t (e.g. a GlobalVariable or AllocaInst).

Definition at line 447 of file VuoCompilerCodeGenUtilities.cc.

◆ generateRetainOrReleaseCall()

void VuoCompilerCodeGenUtilities::generateRetainOrReleaseCall ( Module *  module,
BasicBlock *  block,
Value *  argument,
bool  isRetain 
)
static

Generates any code needed to retain or release argument.

If argument has a primitive, non-pointer type, no code is generated.

If argument has a pointer type, VuoRetain or VuoRelease is called on argument.

If argument has a struct type, this function is called recursively on each member.

Definition at line 2708 of file VuoCompilerCodeGenUtilities.cc.

◆ generateRetainPortContextData()

void VuoCompilerCodeGenUtilities::generateRetainPortContextData ( Module *  module,
BasicBlock *  block,
Value *  portContextValue 
)
static

Generates code that calls vuoRetainPortContextData().

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
portContextValueA value of type PortContext *.

Definition at line 801 of file VuoCompilerCodeGenUtilities.cc.

◆ generateReturnThreadsForChainWorker()

void VuoCompilerCodeGenUtilities::generateReturnThreadsForChainWorker ( Module *  module,
BasicBlock *  block,
Value *  eventIdValue,
Value *  compositionStateValue,
Value *  chainIndexValue 
)
static

Generates a call to vuoReturnThreadsForChainWorker.

Definition at line 1711 of file VuoCompilerCodeGenUtilities.cc.

◆ generateReturnThreadsForTriggerWorker()

void VuoCompilerCodeGenUtilities::generateReturnThreadsForTriggerWorker ( Module *  module,
BasicBlock *  block,
Value *  eventIdValue,
Value *  compositionStateValue 
)
static

Generates a call to vuoReturnThreadsForTriggerWorker.

Definition at line 1685 of file VuoCompilerCodeGenUtilities.cc.

◆ generateRuntimeStateValue()

Value * VuoCompilerCodeGenUtilities::generateRuntimeStateValue ( Module *  module,
BasicBlock *  block 
)
static

Generates code that gets the value of the vuoRuntimeState global variable.

Definition at line 3479 of file VuoCompilerCodeGenUtilities.cc.

◆ generateScheduleChainWorker()

void VuoCompilerCodeGenUtilities::generateScheduleChainWorker ( Module *  module,
BasicBlock *  block,
Value *  queueValue,
Value *  contextValue,
Value *  workerFunctionValue,
int  minThreadsNeeded,
int  maxThreadsNeeded,
Value *  eventIdValue,
Value *  compositionStateValue,
size_t  chainIndex,
vector< size_t >  upstreamChainIndices 
)
static

Generates a call to vuoScheduleChainWorker.

Definition at line 1551 of file VuoCompilerCodeGenUtilities.cc.

◆ generateScheduleTriggerWorker()

void VuoCompilerCodeGenUtilities::generateScheduleTriggerWorker ( Module *  module,
BasicBlock *  block,
Value *  queueValue,
Value *  contextValue,
Value *  workerFunctionValue,
int  minThreadsNeeded,
int  maxThreadsNeeded,
Value *  eventIdValue,
Value *  compositionStateValue,
int  chainCount 
)
static

Generates a call to vuoScheduleTriggerWorker.

Definition at line 1501 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSendEventDropped()

void VuoCompilerCodeGenUtilities::generateSendEventDropped ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  portIdentifierValue 
)
static

Generates a call to vuoSendEventDropped().

Definition at line 3038 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSendEventFinished()

void VuoCompilerCodeGenUtilities::generateSendEventFinished ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  eventIdValue 
)
static

Generates a call to vuoSendEventFinished().

Definition at line 3012 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSendInputPortsUpdated() [1/2]

void VuoCompilerCodeGenUtilities::generateSendInputPortsUpdated ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  portIdentifierValue,
bool  receivedEvent,
bool  receivedData,
Value *  portDataSummaryValue 
)
static

Generates a call to vuoSendInputPortsUpdated().

Definition at line 2896 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSendInputPortsUpdated() [2/2]

void VuoCompilerCodeGenUtilities::generateSendInputPortsUpdated ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  portIdentifierValue,
Value *  receivedEventValue,
Value *  receivedDataValue,
Value *  portDataSummaryValue 
)
static

Generates a call to vuoSendInputPortsUpdated().

Definition at line 2910 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSendNodeExecutionFinished()

void VuoCompilerCodeGenUtilities::generateSendNodeExecutionFinished ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  nodeIdentifierValue 
)
static

Generates a call to vuoSendNodeExecutionFinished().

Definition at line 2870 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSendNodeExecutionStarted()

void VuoCompilerCodeGenUtilities::generateSendNodeExecutionStarted ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  nodeIdentifierValue 
)
static

Generates a call to vuoSendNodeExecutionStarted().

Definition at line 2844 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSendOutputPortsUpdated()

void VuoCompilerCodeGenUtilities::generateSendOutputPortsUpdated ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  portIdentifierValue,
Value *  sentEventValue,
Value *  sentDataValue,
Value *  portDataSummaryValue 
)
static

Generates a call to vuoSendOutputPortsUpdated().

Definition at line 2945 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSendPublishedOutputPortsUpdated()

void VuoCompilerCodeGenUtilities::generateSendPublishedOutputPortsUpdated ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  portIdentifierValue,
Value *  sentDataValue,
Value *  portDataSummaryValue 
)
static

Generates a call to vuoSendPublishedOutputPortsUpdated().

Definition at line 2980 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSerialization()

Value * VuoCompilerCodeGenUtilities::generateSerialization ( Module *  module,
BasicBlock *  block,
Value *  valueToSerialize,
VuoCompilerConstantsCache constantsCache 
)
static

Generates code that creates a string representation of the given value.

Definition at line 2780 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSetArrayElement()

void VuoCompilerCodeGenUtilities::generateSetArrayElement ( Module *  module,
BasicBlock *  block,
Value *  arrayValue,
size_t  elementIndex,
Value *  value 
)
static

Generates code that sets the array element at the given index.

Definition at line 1886 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSetNodeContextClaimingEventId()

void VuoCompilerCodeGenUtilities::generateSetNodeContextClaimingEventId ( Module *  module,
BasicBlock *  block,
Value *  nodeContextValue,
Value *  claimingEventIdValue 
)
static

Generates code that sets the claimingEventId field of a NodeContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
nodeContextValueA value of type NodeContext *.
claimingEventIdValueThe value to set the field to.

Definition at line 943 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSetNodeContextInstanceData()

void VuoCompilerCodeGenUtilities::generateSetNodeContextInstanceData ( Module *  module,
BasicBlock *  block,
Value *  nodeContextValue,
Value *  instanceDataValue 
)
static

Generates code that sets the instanceData field of a NodeContext (to a heap-allocated copy of instanceDataValue) and frees the old value.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
nodeContextValueA value of type NodeContext *.
instanceDataValueThe value to set the field to.

Definition at line 907 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSetNodeContextOutputEvent()

void VuoCompilerCodeGenUtilities::generateSetNodeContextOutputEvent ( Module *  module,
BasicBlock *  block,
Value *  nodeContextValue,
size_t  index,
Value *  eventValue 
)
static

Generates code that sets an element of the outputEvents field of a NodeContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
nodeContextValueA value of type NodeContext *.
indexThe index of the event in the node context's array of output events.
eventValueThe value to set the field to.

Definition at line 975 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSetNodeContextPortContexts()

void VuoCompilerCodeGenUtilities::generateSetNodeContextPortContexts ( Module *  module,
BasicBlock *  block,
Value *  nodeContextValue,
vector< Value * >  portContextValues 
)
static

Generates code that sets the portContexts and portContextCount fields of a NodeContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
nodeContextValueA value of type NodeContext *.
portContextValuesThe values to be placed in an array and stored in the field.

Definition at line 867 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSetPortContextData()

void VuoCompilerCodeGenUtilities::generateSetPortContextData ( Module *  module,
BasicBlock *  block,
Value *  portContextValue,
Value *  dataValue,
VuoCompilerType dataType 
)
static

Generates code that sets the data field of a PortContext to a heap-allocated copy of dataValue.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
portContextValueA value of type PortContext *.
dataValueThe value to set the field to.
dataTypeThe type of the port data.

Definition at line 611 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSetPortContextEvent()

void VuoCompilerCodeGenUtilities::generateSetPortContextEvent ( Module *  module,
BasicBlock *  block,
Value *  portContextValue,
Value *  eventValue 
)
static

Generates code that sets the event field of a PortContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
portContextValueA value of type PortContext *.
eventValueThe value to set the field to.

Definition at line 579 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSetPortContextTriggerFunction()

void VuoCompilerCodeGenUtilities::generateSetPortContextTriggerFunction ( Module *  module,
BasicBlock *  block,
Value *  portContextValue,
Value *  triggerFunctionValue 
)
static

Generates code that sets the triggerFunction field of a PortContext.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
portContextValueA value of type PortContext *.
triggerFunctionValueThe value to set the field to.

Definition at line 625 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSetStructPointerElement()

void VuoCompilerCodeGenUtilities::generateSetStructPointerElement ( Module *  module,
BasicBlock *  block,
Value *  structPointer,
size_t  elementIndex,
Value *  value 
)
static

Generates code that sets the struct element at the given index.

Definition at line 1930 of file VuoCompilerCodeGenUtilities.cc.

◆ generateShouldSendDataTelemetryComparison()

ICmpInst * VuoCompilerCodeGenUtilities::generateShouldSendDataTelemetryComparison ( Module *  module,
BasicBlock *  block,
string  portIdentifier,
Value *  compositionStateValue,
VuoCompilerConstantsCache constantsCache 
)
static

Generates code that gets the return value of the vuoShouldSendPortDataTelemetry() function as a comparison value.

Definition at line 3064 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSignalForSemaphore() [1/2]

void VuoCompilerCodeGenUtilities::generateSignalForSemaphore ( Module *  module,
BasicBlock *  block,
AllocaInst *  semaphoreVariable 
)
static

Generates code that signals a dispatch_semaphore_t.

Definition at line 123 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSignalForSemaphore() [2/2]

void VuoCompilerCodeGenUtilities::generateSignalForSemaphore ( Module *  module,
BasicBlock *  block,
Value *  semaphoreValue 
)
static

Generates code that signals a dispatch_semaphore_t.

Definition at line 132 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSpunOffExecutingEvent()

void VuoCompilerCodeGenUtilities::generateSpunOffExecutingEvent ( Module *  module,
BasicBlock *  block,
Value *  nodeContextValue,
Value *  eventIdValue 
)
static

Generates a call to vuoSpunOffExecutingEvent.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
nodeContextValueThe composition's node context, a value of type NodeContext *.
eventIdValueA value of type unsigned long.

Definition at line 1234 of file VuoCompilerCodeGenUtilities.cc.

◆ generateStartedExecutingEvent()

void VuoCompilerCodeGenUtilities::generateStartedExecutingEvent ( Module *  module,
BasicBlock *  block,
Value *  nodeContextValue,
Value *  eventIdValue 
)
static

Generates a call to vuoStartedExecutingEvent.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
nodeContextValueThe composition's node context, a value of type NodeContext *.
eventIdValueA value of type unsigned long.

Definition at line 1203 of file VuoCompilerCodeGenUtilities.cc.

◆ generateStringConcatenation()

Value * VuoCompilerCodeGenUtilities::generateStringConcatenation ( Module *  module,
BasicBlock *  block,
vector< Value * >  stringsToConcatenate,
VuoCompilerConstantsCache constantsCache 
)
static

Generates code that allocates a buffer to hold the composite string, then concatenates each member of stringsToConcatenate into the composite string.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
stringsToConcatenateThe strings to concatenate. Each element should be a value of type pointer-to-char.
constantsCacheThe cache of LLVM constants used to generate string values.
Returns
A value containing the address of the composite string.

Definition at line 2217 of file VuoCompilerCodeGenUtilities.cc.

◆ generateStringMatchingCode()

void VuoCompilerCodeGenUtilities::generateStringMatchingCode ( Module *  module,
Function *  function,
BasicBlock *  initialBlock,
BasicBlock *  finalBlock,
Value *  inputStringValue,
map< string, pair< BasicBlock *, BasicBlock * > >  blocksForString,
VuoCompilerConstantsCache constantsCache 
)
static

Generates a series of if-else statements for testing if an input string is equal to any of a set of constant strings, and executing the corresponding block of code if it is.

Assumes that none of the blocks passed to this function contain branch instructions. (This function appends branch instructions to all but the final block.)

Example:

if (! strcmp(inputString, string0)) // blockForString[string0] else if (! strcmp(inputString, string1)) // blockForString[string1] ...

Parameters
moduleThe module in which to generate code.
functionThe function in which to generate code.
initialBlockThe block to which the first if-statement will be appended.
finalBlockThe block following the if-else statements.
inputStringValueThe string to compare in each if-statement.
blocksForStringFor each key string, the first block and last block to execute if the input string matches that string. The caller is responsible for branching (directly or indirectly) from the first to the last block.
constantsCacheThe cache of LLVM constants used to generate string values.

Definition at line 2080 of file VuoCompilerCodeGenUtilities.cc.

◆ generateSynchronousSubmissionToDispatchQueue()

void VuoCompilerCodeGenUtilities::generateSynchronousSubmissionToDispatchQueue ( Module *  module,
BasicBlock *  block,
Value *  dispatchQueueValue,
Function *  workerFunction,
Value *  contextValue 
)
static

Generates code that submits a function for synchronous execution on a dispatch queue.

Definition at line 351 of file VuoCompilerCodeGenUtilities.cc.

◆ generateTypeCast()

Value * VuoCompilerCodeGenUtilities::generateTypeCast ( Module *  module,
BasicBlock *  block,
Value *  valueToCast,
Type *  typeToCastTo 
)
static

Generates code to cast the value to the desired type (if it doesn't already have that type).

Returns
A value of type typeToCastTo (which may be valueToCast).

Definition at line 2391 of file VuoCompilerCodeGenUtilities.cc.

◆ generateUnlockNode() [1/2]

void VuoCompilerCodeGenUtilities::generateUnlockNode ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
size_t  nodeIndex 
)
static

Generates a call to vuoUnlockNode().

Definition at line 1849 of file VuoCompilerCodeGenUtilities.cc.

◆ generateUnlockNode() [2/2]

void VuoCompilerCodeGenUtilities::generateUnlockNode ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
Value *  nodeIndexValue 
)
static

Generates a call to vuoUnlockNode().

Definition at line 1859 of file VuoCompilerCodeGenUtilities.cc.

◆ generateUnlockNodes()

void VuoCompilerCodeGenUtilities::generateUnlockNodes ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue,
const vector< size_t > &  nodeIndices,
VuoCompilerConstantsCache constantsCache 
)
static

Generates a call to vuoUnlockNodes().

Definition at line 1815 of file VuoCompilerCodeGenUtilities.cc.

◆ generateUnserialization()

void VuoCompilerCodeGenUtilities::generateUnserialization ( Module *  module,
BasicBlock *  block,
Value *  stringToUnserialize,
Value *  destinationVariable,
VuoCompilerConstantsCache constantsCache 
)
static

Generates code that creates a value of the given type from the given string representation, and stores it in the destination variable.

Definition at line 2801 of file VuoCompilerCodeGenUtilities.cc.

◆ generateWaitForDispatchGroup()

void VuoCompilerCodeGenUtilities::generateWaitForDispatchGroup ( Module *  module,
BasicBlock *  block,
Value *  dispatchGroupValue,
dispatch_time_t  timeout = DISPATCH_TIME_FOREVER 
)
static

Generates code that waits on a dispatch_group_t.

Definition at line 222 of file VuoCompilerCodeGenUtilities.cc.

◆ generateWaitForSemaphore() [1/4]

Value * VuoCompilerCodeGenUtilities::generateWaitForSemaphore ( Module *  module,
BasicBlock *  block,
AllocaInst *  semaphoreVariable 
)
static

Generates code that waits for and claims a dispatch_semaphore_t, with a timeout of DISPATCH_TIME_FOREVER.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
semaphoreVariableThe semaphore.
Returns
The return value of dispatch_semaphore_wait().

Definition at line 60 of file VuoCompilerCodeGenUtilities.cc.

◆ generateWaitForSemaphore() [2/4]

Value * VuoCompilerCodeGenUtilities::generateWaitForSemaphore ( Module *  module,
BasicBlock *  block,
AllocaInst *  semaphoreVariable,
Value *  timeoutValue 
)
static

Generates code that waits for and possibly claims a dispatch_semaphore_t.

Parameters
moduleThe module in which to generate code.
blockThe block in which to generate code.
semaphoreVariableThe semaphore.
timeoutValueA value of type dispatch_time_t to pass to dispatch_semaphore_wait().
Returns
The return value of dispatch_semaphore_wait().

Definition at line 75 of file VuoCompilerCodeGenUtilities.cc.

◆ generateWaitForSemaphore() [3/4]

Value * VuoCompilerCodeGenUtilities::generateWaitForSemaphore ( Module *  module,
BasicBlock *  block,
Value *  semaphoreValue 
)
static

Generates code that waits for and claims a dispatch_semaphore_t, with a timeout of DISPATCH_TIME_FOREVER.

Definition at line 84 of file VuoCompilerCodeGenUtilities.cc.

◆ generateWaitForSemaphore() [4/4]

Value * VuoCompilerCodeGenUtilities::generateWaitForSemaphore ( Module *  module,
BasicBlock *  block,
Value *  semaphoreValue,
Value *  timeoutValue 
)
static

Generates code that waits for and possibly claims a dispatch_semaphore_t.

Definition at line 94 of file VuoCompilerCodeGenUtilities.cc.

◆ getAnnotateFunction()

Function * VuoCompilerCodeGenUtilities::getAnnotateFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4058 of file VuoCompilerCodeGenUtilities.cc.

◆ getArgumentAtIndex()

Value * VuoCompilerCodeGenUtilities::getArgumentAtIndex ( Function *  function,
size_t  index 
)
static

Returns the argument at index (numbered from 0) in the function's argument list.

Definition at line 5130 of file VuoCompilerCodeGenUtilities.cc.

◆ getCleanupFunction()

Function * VuoCompilerCodeGenUtilities::getCleanupFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4355 of file VuoCompilerCodeGenUtilities.cc.

◆ getCompositionAddNodeMetadataFunction()

Function * VuoCompilerCodeGenUtilities::getCompositionAddNodeMetadataFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4264 of file VuoCompilerCodeGenUtilities.cc.

◆ getCompositionCreateContextForNodeFunction()

Function * VuoCompilerCodeGenUtilities::getCompositionCreateContextForNodeFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4283 of file VuoCompilerCodeGenUtilities.cc.

◆ getCompositionFireTriggerPortEventFunction()

Function * VuoCompilerCodeGenUtilities::getCompositionFireTriggerPortEventFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4901 of file VuoCompilerCodeGenUtilities.cc.

◆ getCompositionGetPortValueFunction()

Function * VuoCompilerCodeGenUtilities::getCompositionGetPortValueFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4849 of file VuoCompilerCodeGenUtilities.cc.

◆ getCompositionInstanceDataType()

PointerType * VuoCompilerCodeGenUtilities::getCompositionInstanceDataType ( Module *  module)
static

Returns a Type reference, generating code for the declaration if needed.

Definition at line 3864 of file VuoCompilerCodeGenUtilities.cc.

◆ getCompositionPerformDataOnlyTransmissionsFunction()

Function * VuoCompilerCodeGenUtilities::getCompositionPerformDataOnlyTransmissionsFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4303 of file VuoCompilerCodeGenUtilities.cc.

◆ getCompositionReleasePortDataFunction()

Function * VuoCompilerCodeGenUtilities::getCompositionReleasePortDataFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4322 of file VuoCompilerCodeGenUtilities.cc.

◆ getCompositionSetPortValueFunction()

Function * VuoCompilerCodeGenUtilities::getCompositionSetPortValueFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4873 of file VuoCompilerCodeGenUtilities.cc.

◆ getCompositionSetPublishedInputPortValueFunction()

Function * VuoCompilerCodeGenUtilities::getCompositionSetPublishedInputPortValueFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4975 of file VuoCompilerCodeGenUtilities.cc.

◆ getCompositionStateType()

StructType * VuoCompilerCodeGenUtilities::getCompositionStateType ( Module *  module)
static

Returns a Type reference, generating code for the declaration if needed.

Definition at line 3794 of file VuoCompilerCodeGenUtilities.cc.

◆ getDispatchGroupType()

PointerType * VuoCompilerCodeGenUtilities::getDispatchGroupType ( Module *  module)
static

Returns a Type reference, generating code for the declaration if needed.

Definition at line 3698 of file VuoCompilerCodeGenUtilities.cc.

◆ getDispatchObjectType()

StructType * VuoCompilerCodeGenUtilities::getDispatchObjectType ( Module *  module)
static

Returns a Type reference, generating code for the declaration if needed.

Definition at line 3729 of file VuoCompilerCodeGenUtilities.cc.

◆ getDispatchSemaphoreType()

PointerType * VuoCompilerCodeGenUtilities::getDispatchSemaphoreType ( Module *  module)
static

Returns a Type reference, generating code for the declaration if needed.

Definition at line 3688 of file VuoCompilerCodeGenUtilities.cc.

◆ getFprintfFunction()

Function * VuoCompilerCodeGenUtilities::getFprintfFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 3975 of file VuoCompilerCodeGenUtilities.cc.

◆ getFreeFunction()

Function * VuoCompilerCodeGenUtilities::getFreeFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4042 of file VuoCompilerCodeGenUtilities.cc.

◆ getFunctionType()

FunctionType * VuoCompilerCodeGenUtilities::getFunctionType ( Module *  module,
VuoType paramType 
)
static

Returns a function type that accepts a vuoType (or its lowered form) as its parameter and has a void return type.

Definition at line 5117 of file VuoCompilerCodeGenUtilities.cc.

◆ getGetPublishedInputPortValueFunction()

Function * VuoCompilerCodeGenUtilities::getGetPublishedInputPortValueFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4939 of file VuoCompilerCodeGenUtilities.cc.

◆ getGetPublishedOutputPortValueFunction()

Function * VuoCompilerCodeGenUtilities::getGetPublishedOutputPortValueFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4957 of file VuoCompilerCodeGenUtilities.cc.

◆ getInstanceFiniFunction()

Function * VuoCompilerCodeGenUtilities::getInstanceFiniFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4379 of file VuoCompilerCodeGenUtilities.cc.

◆ getInstanceInitFunction()

Function * VuoCompilerCodeGenUtilities::getInstanceInitFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4367 of file VuoCompilerCodeGenUtilities.cc.

◆ getInstanceTriggerStartFunction()

Function * VuoCompilerCodeGenUtilities::getInstanceTriggerStartFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4391 of file VuoCompilerCodeGenUtilities.cc.

◆ getInstanceTriggerStopFunction()

Function * VuoCompilerCodeGenUtilities::getInstanceTriggerStopFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4403 of file VuoCompilerCodeGenUtilities.cc.

◆ getJsonObjectPutFunction()

Function * VuoCompilerCodeGenUtilities::getJsonObjectPutFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4077 of file VuoCompilerCodeGenUtilities.cc.

◆ getJsonObjectToJsonStringExtFunction()

Function * VuoCompilerCodeGenUtilities::getJsonObjectToJsonStringExtFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4093 of file VuoCompilerCodeGenUtilities.cc.

◆ getJsonObjectType()

StructType * VuoCompilerCodeGenUtilities::getJsonObjectType ( Module *  module)
static

Returns a Type reference, generating code for the declaration if needed.

Definition at line 3823 of file VuoCompilerCodeGenUtilities.cc.

◆ getJsonTokenerParseFunction()

Function * VuoCompilerCodeGenUtilities::getJsonTokenerParseFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4111 of file VuoCompilerCodeGenUtilities.cc.

◆ getMallocFunction()

Function * VuoCompilerCodeGenUtilities::getMallocFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4008 of file VuoCompilerCodeGenUtilities.cc.

◆ getMemcpyFunction()

Function * VuoCompilerCodeGenUtilities::getMemcpyFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4024 of file VuoCompilerCodeGenUtilities.cc.

◆ getNodeContextType()

StructType * VuoCompilerCodeGenUtilities::getNodeContextType ( Module *  module)
static

Returns a Type reference, generating code for the declaration if needed.

Definition at line 3744 of file VuoCompilerCodeGenUtilities.cc.

◆ getNodeEventFunction()

Function * VuoCompilerCodeGenUtilities::getNodeEventFunction ( Module *  module,
string  moduleKey,
bool  isSubcomposition,
bool  isStateful,
Type *  instanceDataType,
const vector< VuoPort * > &  modelInputPorts,
const vector< VuoPort * > &  modelOutputPorts,
const map< VuoPort *, json_object * > &  detailsForPorts,
const map< VuoPort *, string > &  displayNamesForPorts,
const map< VuoPort *, string > &  defaultValuesForInputPorts,
const map< VuoPort *, VuoPortClass::EventBlocking > &  eventBlockingForInputPorts,
map< VuoPort *, size_t > &  indexOfParameter,
map< VuoPort *, size_t > &  indexOfEventParameter,
VuoCompilerConstantsCache constantsCache 
)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4473 of file VuoCompilerCodeGenUtilities.cc.

◆ getNodeInstanceFiniFunction()

Function * VuoCompilerCodeGenUtilities::getNodeInstanceFiniFunction ( Module *  module,
string  moduleKey,
Type *  instanceDataType,
VuoCompilerConstantsCache constantsCache 
)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4427 of file VuoCompilerCodeGenUtilities.cc.

◆ getNodeInstanceInitFunction()

Function * VuoCompilerCodeGenUtilities::getNodeInstanceInitFunction ( Module *  module,
string  moduleKey,
bool  isSubcomposition,
Type *  instanceDataType,
const vector< VuoPort * > &  modelInputPorts,
map< VuoPort *, size_t > &  indexOfParameter,
VuoCompilerConstantsCache constantsCache 
)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4415 of file VuoCompilerCodeGenUtilities.cc.

◆ getNodeInstanceTriggerStartFunction()

Function * VuoCompilerCodeGenUtilities::getNodeInstanceTriggerStartFunction ( Module *  module,
string  moduleKey,
Type *  instanceDataType,
const vector< VuoPort * > &  modelInputPorts,
map< VuoPort *, size_t > &  indexOfParameter,
VuoCompilerConstantsCache constantsCache 
)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4438 of file VuoCompilerCodeGenUtilities.cc.

◆ getNodeInstanceTriggerStopFunction()

Function * VuoCompilerCodeGenUtilities::getNodeInstanceTriggerStopFunction ( Module *  module,
string  moduleKey,
Type *  instanceDataType,
VuoCompilerConstantsCache constantsCache 
)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4450 of file VuoCompilerCodeGenUtilities.cc.

◆ getNodeInstanceTriggerUpdateFunction()

Function * VuoCompilerCodeGenUtilities::getNodeInstanceTriggerUpdateFunction ( Module *  module,
string  moduleKey,
Type *  instanceDataType,
const vector< VuoPort * > &  modelInputPorts,
map< VuoPort *, size_t > &  indexOfParameter,
VuoCompilerConstantsCache constantsCache 
)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4461 of file VuoCompilerCodeGenUtilities.cc.

◆ getPortContextType()

StructType * VuoCompilerCodeGenUtilities::getPortContextType ( Module *  module)
static

Returns a Type reference, generating code for the declaration if needed.

Definition at line 3770 of file VuoCompilerCodeGenUtilities.cc.

◆ getPutsFunction()

Function * VuoCompilerCodeGenUtilities::getPutsFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 3992 of file VuoCompilerCodeGenUtilities.cc.

◆ getSetInputPortValueFunction()

Function * VuoCompilerCodeGenUtilities::getSetInputPortValueFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4922 of file VuoCompilerCodeGenUtilities.cc.

◆ getSetPublishedInputPortValueFunction()

Function * VuoCompilerCodeGenUtilities::getSetPublishedInputPortValueFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4999 of file VuoCompilerCodeGenUtilities.cc.

◆ getSetupFunction()

Function * VuoCompilerCodeGenUtilities::getSetupFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4343 of file VuoCompilerCodeGenUtilities.cc.

◆ getSnprintfFunction()

Function * VuoCompilerCodeGenUtilities::getSnprintfFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 3940 of file VuoCompilerCodeGenUtilities.cc.

◆ getSscanfFunction()

Function * VuoCompilerCodeGenUtilities::getSscanfFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 3958 of file VuoCompilerCodeGenUtilities.cc.

◆ getStrcatFunction()

Function * VuoCompilerCodeGenUtilities::getStrcatFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 3875 of file VuoCompilerCodeGenUtilities.cc.

◆ getStrcmpFunction()

Function * VuoCompilerCodeGenUtilities::getStrcmpFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 3892 of file VuoCompilerCodeGenUtilities.cc.

◆ getStrdupFunction()

Function * VuoCompilerCodeGenUtilities::getStrdupFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 3908 of file VuoCompilerCodeGenUtilities.cc.

◆ getStrlenFunction()

Function * VuoCompilerCodeGenUtilities::getStrlenFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 3924 of file VuoCompilerCodeGenUtilities.cc.

◆ getTriggerWorkersScheduledValue()

Value * VuoCompilerCodeGenUtilities::getTriggerWorkersScheduledValue ( Module *  module,
BasicBlock *  block,
Value *  compositionStateValue 
)
static

Generates a call to vuoGetTriggerWorkersScheduled().

Definition at line 3398 of file VuoCompilerCodeGenUtilities.cc.

◆ getVuoImageGetColorDepthFunction()

Function * VuoCompilerCodeGenUtilities::getVuoImageGetColorDepthFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4225 of file VuoCompilerCodeGenUtilities.cc.

◆ getVuoImageRendererRenderFunction()

Function * VuoCompilerCodeGenUtilities::getVuoImageRendererRenderFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4242 of file VuoCompilerCodeGenUtilities.cc.

◆ getVuoSamplerRectCoordinatesFromNormalizedCoordinatesFunction()

Function * VuoCompilerCodeGenUtilities::getVuoSamplerRectCoordinatesFromNormalizedCoordinatesFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4206 of file VuoCompilerCodeGenUtilities.cc.

◆ getVuoShaderAddSourceFunction()

Function * VuoCompilerCodeGenUtilities::getVuoShaderAddSourceFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4145 of file VuoCompilerCodeGenUtilities.cc.

◆ getVuoShaderMakeFunction()

Function * VuoCompilerCodeGenUtilities::getVuoShaderMakeFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4128 of file VuoCompilerCodeGenUtilities.cc.

◆ getVuoShaderSetTransparentFunction()

Function * VuoCompilerCodeGenUtilities::getVuoShaderSetTransparentFunction ( Module *  module)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4167 of file VuoCompilerCodeGenUtilities.cc.

◆ getVuoShaderSetUniformFunction()

Function * VuoCompilerCodeGenUtilities::getVuoShaderSetUniformFunction ( Module *  module,
VuoCompilerType type 
)
static

Returns a Function reference, generating code for the declaration if needed.

Definition at line 4185 of file VuoCompilerCodeGenUtilities.cc.

◆ isFunctionReturningStructViaParameter()

bool VuoCompilerCodeGenUtilities::isFunctionReturningStructViaParameter ( Function *  function)
static

Returns true if the function's first parameter has LLVM's sret attribute, or in other words, LLVM has transformed struct MyType foo(...) to void foo(struct MyType *, ...).

Definition at line 5054 of file VuoCompilerCodeGenUtilities.cc.

◆ isPointerToStruct()

bool VuoCompilerCodeGenUtilities::isPointerToStruct ( Type *  type,
StructType **  structType = nullptr 
)
static

Returns true and outputs the struct type if type is a pointer to a struct.

Definition at line 5020 of file VuoCompilerCodeGenUtilities.cc.

◆ isRetainOrReleaseNeeded()

bool VuoCompilerCodeGenUtilities::isRetainOrReleaseNeeded ( Type *  type)
static

Returns true if VuoCompilerCodeGenUtilities::generateRetainCall and VuoCompilerCodeGenUtilities::generateReleaseCall would generate any code for type.

Definition at line 2737 of file VuoCompilerCodeGenUtilities.cc.


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