Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard

A ComponentPass is a pass that operates on a Component. If used with executePassSequential, one Pass object is instantiated for each Component in a TranslationResult.

Link copied to clipboard

This pass determines the data flows of DeclaredReferenceExpressions which refer to a VariableDeclaration (not a field) while considering the control flow of a function. After this path, only such data flows are left which can occur when following the control flow (in terms of the EOG) of the program.

Link copied to clipboard

Adds the DFG edges for various types of nodes.

Link copied to clipboard
class Edge(val source: Node, val target: Node, val type: EdgeType)
Link copied to clipboard

This pass creates a simple cache of commonly used edges, such as DFG or AST to quickly traverse them in different directions.

Link copied to clipboard
object Edges

The edges cache.

Link copied to clipboard
Link copied to clipboard

Creates an Evaluation Order Graph (EOG) based on AST.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed class Pass<T : PassTarget> : Consumer<T> , ContextProvider

Represents an abstract class that enhances the graph before it is persisted. Passes can exist at three different levels:

Link copied to clipboard
interface PassTarget

A pass target is an interface for a Node on which a Pass can operate, it should only be implemented by TranslationResult, Component and TranslationUnitDeclaration.

Link copied to clipboard

Pass with some graph transformations useful when doing serialization.

Link copied to clipboard

A Pass collecting statistics for the graph. Currently, it collects the number of nodes and the number of problem nodes (i.e., nodes where the translation failed for some reason).

Link copied to clipboard
Link copied to clipboard

A TranslationResultPass is a pass that operates on a TranslationResult. If used with executePassSequential, one Pass object is instantiated for the whole TranslationResult.

Link copied to clipboard

A TranslationUnitPass is a pass that operates on a TranslationUnitDeclaration. If used with executePassSequential, one Pass object is instantiated for each TranslationUnitDeclaration in a Component.

Link copied to clipboard

Transitively connect RecordDeclaration nodes with their supertypes' records.

Link copied to clipboard
Link copied to clipboard

Creates new connections between the place where a variable is declared and where it is used.

Functions

Link copied to clipboard

Adds the resolved default template arguments recursively to the templateParameter list of the ConstructExpression until a fixpoint is reached e.g. template

Link copied to clipboard

Changes the arguments of the CallExpression to use the implicit casts instead

Link copied to clipboard
fun applyMissingParams(template: ClassTemplateDeclaration, constructExpression: ConstructExpression, templateParametersExplicitInitialization: Map<Node, Node>, templateParameterRealDefaultInitialization: Map<Node, Node?>)

Apply missingParameters (either explicit or defaults) to the ConstructExpression and its type

Link copied to clipboard
fun applyTemplateInstantiation(templateCall: CallExpression, functionTemplateDeclaration: FunctionTemplateDeclaration?, function: FunctionDeclaration, initializationSignature: Map<Declaration?, Node?>, initializationType: Map<Node?, TemplateDeclaration.TemplateInitialization?>, orderedInitializationSignature: Map<Declaration, Int>, ctx: TranslationContext): 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 ParamVariableDeclaration in TemplateDeclaration

Link copied to clipboard
fun checkArgumentValidity(functionDeclaration: FunctionDeclaration, functionDeclarationSignature: List<Type>, templateCallExpression: CallExpression, explicitInstantiation: List<ParameterizedType>): Boolean
Link copied to clipboard
fun <T : PassTarget> checkForReplacement(cls: KClass<out Pass<T>>, language: Language<*>?, config: TranslationConfiguration): KClass<out Pass<T>>

Checks, whether the specified pass has a replacement configured in config for the given language. Currently, we only allow replacement on translation unit level, as this is the only level which has a single language set.

Link copied to clipboard
fun checkMostCommonImplicitCast(implicitCasts: MutableList<CastExpression?>, implicitCastTargets: List<CastExpression?>)

Checks if the current casts are compatible with the casts necessary to match with a new FunctionDeclaration. If a one argument would need to be cast in two different types it would be modified to a cast to UnknownType

Link copied to clipboard
fun compatibleSignatures(callSignature: List<Type?>, functionSignature: List<Type>, ctx: TranslationContext): Boolean

Creates a Mapping between the Parameters of the TemplateDeclaration and the Values provided for the instantiation of the template (Only the ones that are in defined in the instantiation => no defaults or implicit). Additionally, it fills the maps and lists mentioned below:

Link copied to clipboard
inline fun <T : PassTarget> executePass(cls: KClass<out Pass<T>>, ctx: TranslationContext, target: T, executedFrontends: Collection<LanguageFrontend>): Pass<T>?
Link copied to clipboard

Creates a new Pass (based on cls) and executes it sequentially on the nodes of result. Depending on the type of pass, this will either execute the pass directly on the overall result, loop through each component or through each translation unit.

Link copied to clipboard
fun getCallSignature(function: FunctionDeclaration, parameterizedTypeResolution: Map<ParameterizedType, TypeParamDeclaration>, initializationSignature: Map<Declaration?, Node?>): List<Type>
Link copied to clipboard

Gets all ParameterizedTypes from the initialization signature

Link copied to clipboard
fun getTemplateInitializationSignature(functionTemplateDeclaration: FunctionTemplateDeclaration, templateCall: CallExpression, instantiationType: MutableMap<Node?, TemplateDeclaration.TemplateInitialization?>, orderedInitializationSignature: MutableMap<Declaration, Int>, explicitInstantiated: MutableList<ParameterizedType>, ctx: TranslationContext): Map<Declaration?, Node?>?

Creates a Mapping between the Parameters of the TemplateDeclaration and the Values provided * for the instantiation of the template.

Link copied to clipboard
fun handleDefaultTemplateParameters(template: ClassTemplateDeclaration, templateParameterRealDefaultInitialization: MutableMap<Node, Node?>)

Matches declared template arguments to their defaults (without defaults of a previously defined template argument)

Link copied to clipboard
fun handleExplicitTemplateParameters(constructExpression: ConstructExpression, template: ClassTemplateDeclaration, templateParametersExplicitInitialization: MutableMap<Node, Node>)

Matches declared template arguments to the explicit instantiation

Link copied to clipboard
fun handleImplicitTemplateParameter(functionTemplateDeclaration: FunctionTemplateDeclaration, index: Int, instantiationSignature: MutableMap<Declaration?, Node?>, instantiationType: MutableMap<Node?, TemplateDeclaration.TemplateInitialization?>, orderedInitializationSignature: MutableMap<Declaration, Int>)

Check if we are handling an implicit template parameter, if so set instantiationSignature, instantiationType and orderedInitializationSignature maps accordingly

Link copied to clipboard
fun isInstantiated(callParameterArg: Node, templateParameter: Declaration?, typeManager: TypeManager): Boolean

Checks if the provided call parameter can instantiate the required template parameter

Link copied to clipboard
fun resolveConstructorWithDefaults(constructExpression: ConstructExpression, signature: List<Type?>, recordDeclaration: RecordDeclaration): ConstructorDeclaration?
Link copied to clipboard

Resolves a CallExpression to the potential target FunctionDeclarations by checking for omitted arguments due to previously defined default arguments

Link copied to clipboard

modifies: call arguments by applying implicit casts

Link copied to clipboard

In C++ if there is a method that matches the name we are looking for, we have to stop searching in the parents even if the signature of the method does not match

Link copied to clipboard

Computes the implicit casts that are necessary to reach the

Properties

Link copied to clipboard