Package-level declarations
Types
A ComponentPass is a pass that operates on a Component. If used with executePass, one Pass object is instantiated for each Component in a TranslationResult.
This pass builds the Control Dependence Graph (CDG) by iterating through the EOG.
This pass determines the data flows of References 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.
Adds the DFG edges for various types of nodes.
This Pass is responsible for resolving dynamic function invokes, i.e., CallExpression nodes that contain a reference/pointer to a function and are being "called". A common example includes C/C++ function pointers.
A EOGStarterPass is a pass that operates on nodes that are contained in a EOGStarterHolder. If used with executePass, one Pass object is instantiated for each Node in a EOGStarterHolder in each TranslationUnitDeclaration in each Component.
Creates an Evaluation Order Graph (EOG) based on the CPG's version of the AST. The expected outcomes are specified in the Specification.
This class holds the information about import dependencies between TranslationUnitDeclaration nodes. The dependency is based on which translation unit imports symbols of another translation unit (usually in the form of a NamespaceDeclaration). The idea is to provide a sorted list of TUs in which to resolve symbols and imports ideally. This is stored in sortedTranslationUnits and is automatically computed the fist time someone accesses the property.
This pass looks for ImportDeclaration nodes and imports symbols into their respective Scope. It does so by first building a dependency map between TranslationUnitDeclaration nodes, based on their ImportDeclaration nodes.
Represents an abstract class that enhances the graph before it is persisted. Passes can exist at three different levels:
Pass with some graph transformations useful when doing serialization.
Implements the LatticeElement over a set of nodes and their set of "nextEOG" nodes which reach this node.
A state which actually holds a state for all Edges. It maps the node to its BranchingNode-parent and the path through which it is reached.
This pass collects the dependence information of each node into a Program Dependence Graph (PDG) by traversing through the AST.
If a Language has the trait HasCallExpressionAmbiguity, we cannot distinguish between CallExpression, CastExpression or ConstructExpression during the initial translation. This stems from the fact that we might not know all the types yet. We therefore need to handle them as regular call expression in a LanguageFrontend or Handler and then later replace them with a CastExpression or ConstructExpression, if the CallExpression.callee refers to name of a Type / RecordDeclaration rather than a function.
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).
Creates new connections between the place where a variable is declared and where it is used.
A TranslationResultPass is a pass that operates on a TranslationResult. If used with executePass, one Pass object is instantiated for the whole TranslationResult.
A TranslationUnitPass is a pass that operates on a TranslationUnitDeclaration. If used with executePass, one Pass object is instantiated for each TranslationUnitDeclaration in a Component.
Transitively connect RecordDeclaration nodes with their supertypes' records.
The purpose of this Pass is to establish a relationship between Type nodes (more specifically ObjectTypes) and their RecordDeclaration.
Properties
Functions
Adds the resolved default template arguments recursively to the templateParameter list of the ConstructExpression until a fixpoint is reached e.g. template
Apply missingParameters (either explicit or defaults) to the ConstructExpression and its type
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
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:
Gets all ParameterizedTypes from the initialization signature
Creates a Mapping between the Parameters of the TemplateDeclaration and the Values provided * for the instantiation of the template.
Matches declared template arguments to their defaults (without defaults of a previously defined template argument)
This method is executed for each EOG edge which is in the worklist. currentEdge is the edge to process, currentState contains the state which was observed before arriving here.
Matches declared template arguments to the explicit instantiation
Check if we are handling an implicit template parameter, if so set instantiationSignature, instantiationType and orderedInitializationSignature maps accordingly
Checks if the provided call parameter can instantiate the required template parameter
The "object identifier" of a node can be used to differentiate different "objects" that a node (most likely a Reference) refers to.
Implements Node.objectIdentifier for a MemberExpression.
Implements Node.objectIdentifier for a Reference.
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
Computes the implicit casts that are necessary to reach the