Package-level declarations

Types

Link copied to clipboard
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
class DFGPass : Pass

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

This Pass is responsible for resolving function pointer calls, i.e., CallExpression nodes that contain a reference/pointer to a function and are being "called". This pass is intentionally split from the CallResolver because it depends on DFG edges. This split allows the CallResolver to be run before any DFG passes, which in turn allow us to also populate DFG passes for inferred functions.

Link copied to clipboard
open class ImportResolver : Pass
Link copied to clipboard
abstract class Pass : Consumer<TranslationResult>

Represents an abstract class that enhances the graph before it is persisted.

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
abstract class SymbolResolverPass : Pass
Link copied to clipboard

Transitively RecordDeclaration nodes with their supertypes' records.

Link copied to clipboard
open class TypeResolver : Pass
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>): 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 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>, provider: ScopeProvider): 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
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?>): 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

Handle calls in the form of super.call() or ClassName.super.call(), conforming to JLS13 §15.12.1.

Link copied to clipboard
fun isInstantiated(callParameterArg: Node, templateParameter: Declaration?): 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
fun signatureWithImplicitCastTransformation(callSignature: List<Type?>, arguments: List<Expression?>, functionSignature: List<Type>): MutableList<CastExpression?>

Computes the implicit casts that are necessary to reach the

Properties

Link copied to clipboard