io.joern.x2cpg.passes.frontend
Members list
Type members
Classlikes
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Dereferenceclass Objecttrait Matchableclass AnyShow all
A collection object that can be accessed with potentially dynamic keys and values.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Dereferenceclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
Dereference.type
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class CDereferenceclass DefaultDereference
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ImportStringHandling.type
Represents an identifier of some AST node at an intraprocedural scope.
Represents an identifier of some AST node at an intraprocedural scope.
Attributes
- Supertypes
- Known subtypes
A pass that creates a MetaData node, specifying that this is a CPG for language, and a NamespaceBlock for anything that cannot be assigned to any other namespace.
A pass that creates a MetaData node, specifying that this is a CPG for language, and a NamespaceBlock for anything that cannot be assigned to any other namespace.
Attributes
- Companion
- object
- Supertypes
-
class CpgPassclass ForkJoinParallelCpgPass[AnyRef]class NewStyleCpgPassBase[AnyRef]trait CpgPassBaseclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
MetaDataPass.type
Performs type recovery from the root of a compilation unit level
Performs type recovery from the root of a compilation unit level
Type parameters
- CompilationUnitType
-
the AstNode type used to represent a compilation unit of the language.
Value parameters
- builder
-
the graph builder
- cpg
-
the graph.
- cu
-
a compilation unit, e.g. file, procedure, type, etc.
Attributes
- Supertypes
-
trait Runnableclass Objecttrait Matchableclass Any
Represents an identifier of some AST node at a specific scope.
Represents an identifier of some AST node at a specific scope.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
A thread-safe symbol table that can represent multiple types per symbol. Each node in an AST gets converted to an SBKey which gives contextual information to identify an AST entity. Each value in this table represents a set of types that the key could be in a flow-insensitive manner.
A thread-safe symbol table that can represent multiple types per symbol. Each node in an AST gets converted to an SBKey which gives contextual information to identify an AST entity. Each value in this table represents a set of types that the key could be in a flow-insensitive manner.
The SymbolTable operates like a map with a few convenient methods that are designed for this structure's purpose.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Creates a TYPE
node for each type in usedTypes
as well as all inheritsFrom type names in the CPG
Creates a TYPE
node for each type in usedTypes
as well as all inheritsFrom type names in the CPG
Alternatively, set getTypesFromCpg = true
. If this is set, the registeredTypes
argument will be ignored. Instead, type nodes will be created for every unique TYPE_FULL_NAME
value in the CPG.
Attributes
- Companion
- object
- Supertypes
-
class CpgPassclass ForkJoinParallelCpgPass[AnyRef]class NewStyleCpgPassBase[AnyRef]trait CpgPassBaseclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
TypeNodePass.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
R
Scans for and inserts configuration files into the CPG. Relies on the MetaData's ROOT
property to provide the path to scan.
Scans for and inserts configuration files into the CPG. Relies on the MetaData's ROOT
property to provide the path to scan.
Attributes
- Supertypes
-
class ConcurrentWriterCpgPass[File]class NewStyleCpgPassBase[File]trait CpgPassBaseclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class ConcurrentWriterCpgPass[Import]class NewStyleCpgPassBase[Import]trait CpgPassBaseclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class ConcurrentWriterCpgPass[(Call, Assignment)]class NewStyleCpgPassBase[(Call, Assignment)]trait CpgPassBaseclass Objecttrait Matchableclass AnyShow all
Using some basic heuristics, will try to resolve type full names from types found within the CPG. Requires ImportPass as a pre-requisite.
Using some basic heuristics, will try to resolve type full names from types found within the CPG. Requires ImportPass as a pre-requisite.
Attributes
- Supertypes
-
class ForkJoinParallelCpgPass[TypeDecl]class NewStyleCpgPassBase[TypeDecl]trait CpgPassBaseclass Objecttrait Matchableclass AnyShow all
Attempts to set the methodFullName
and link to callees using the recovered type information from XTypeRecovery. Note that some methods may not be present as they could be external and have been dynamically discovered, thus the io.joern.x2cpg.passes.base.MethodStubCreator would have missed it.
Attempts to set the methodFullName
and link to callees using the recovered type information from XTypeRecovery. Note that some methods may not be present as they could be external and have been dynamically discovered, thus the io.joern.x2cpg.passes.base.MethodStubCreator would have missed it.
Value parameters
- cpg
-
the target code property graph.
Attributes
- Companion
- object
- Supertypes
-
class CpgPassclass ForkJoinParallelCpgPass[AnyRef]class NewStyleCpgPassBase[AnyRef]trait CpgPassBaseclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
XTypeHintCallLinker.type
Based on a flow-insensitive static single-assignment symbol-table-style approach. This pass aims to be fast and deterministic and does not try to converge to some fixed point but rather iterates a fixed number of times. This will help recover:
Based on a flow-insensitive static single-assignment symbol-table-style approach. This pass aims to be fast and deterministic and does not try to converge to some fixed point but rather iterates a fixed number of times. This will help recover:
- Imported call signatures from external dependencies
- Dynamic type hints for mutable variables in a compilation unit.
The algorithm flows roughly as follows:
- Scan for method signatures of methods for each compilation unit, either by internally defined methods or by reading import signatures. This includes looking for aliases, e.g. import foo as bar.
- (Optionally) Prune these method signatures by checking their validity against the CPG.
- Visit assignments to populate where variables are assigned a value to extrapolate its type. Store these values in a local symbol table. If a field is assigned a value, store this in the global table
- Find instances of where these fields and variables are used and update their type information.
- If this variable is the receiver of a call, make sure to set the type of the call accordingly.
The symbol tables use the SymbolTable class to track possible type information.
Note: Local symbols are cleared once a compilation unit is complete. This is to keep memory usage down while maximizing concurrency.
Type parameters
- CompilationUnitType
-
the AstNode type used to represent a compilation unit of the language.
Value parameters
- cpg
-
the CPG to recovery types for.
Attributes
- Companion
- object
- Supertypes
-
class ForkJoinParallelCpgPass[CompilationUnitType]class NewStyleCpgPassBase[CompilationUnitType]trait CpgPassBaseclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
XTypeRecovery.type
Value parameters
- enabledDummyTypes
-
whether to enable placeholder dummy values for partially resolved types during the final iteration.
- iterations
-
the number of iterations to run.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
In order to propagate types across compilation units, but avoid the poor scalability of a fixed-point algorithm, the number of iterations can be configured using the iterations parameter. Note that iterations < 2 will not provide any interprocedural type recovery capabilities.
In order to propagate types across compilation units, but avoid the poor scalability of a fixed-point algorithm, the number of iterations can be configured using the iterations parameter. Note that iterations < 2 will not provide any interprocedural type recovery capabilities.
Type parameters
- CompilationUnitType
-
the AstNode type used to represent a compilation unit of the language.
Value parameters
- cpg
-
the CPG to recovery types for.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Value parameters
- config
-
the user defined config.
- currentIteration
-
the current iteration.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any