applyTemplateInstantiation

fun applyTemplateInstantiation(templateCall: CallExpression, functionTemplateDeclaration: FunctionTemplateDeclaration?, function: FunctionDeclaration, initializationSignature: Map<Declaration?, Node?>, initializationType: Map<Node?, TemplateDeclaration.TemplateInitialization?>, orderedInitializationSignature: Map<Declaration, Int>): List<FunctionDeclaration>

Performs all necessary steps to make a CallExpression instantiate a template: 1. Set TemplateInstantiation Edge from CallExpression to Template 2. Set Invokes Edge to all realizations of the Template 3. Set return type of the CallExpression and checks if it uses a ParameterizedType and therefore has to be instantiated 4. Set Template Parameters Edge from the CallExpression to all Instantiation Values 5. Set DFG Edges from instantiation to ParameterDeclaration in TemplateDeclaration

Parameters

templateCall

call to instantiate and invoke a function template

functionTemplateDeclaration

functionTemplate we have identified that should be instantiated

function

FunctionDeclaration representing the realization of the template

initializationSignature

mapping containing the all elements of the signature of the TemplateDeclaration as key and the Type/Expression the Parameter is initialized with.

initializationType

mapping of the instantiation value to the instantiation type (depends on resolution TemplateDeclaration.TemplateInitialization

orderedInitializationSignature

mapping of the ordering of the template parameters