io.shiftleft.passes
Members list
Type members
Classlikes
A single-threaded CPG pass. This is the simplest pass to implement: override run and add desired graph modifications to the provided DiffGraphBuilder.
A single-threaded CPG pass. This is the simplest pass to implement: override run and add desired graph modifications to the provided DiffGraphBuilder.
Internally implemented as a ForkJoinParallelCpgPass with a single part and parallelism disabled.
Value parameters
- cpg
-
the code property graph to modify
- outName
-
optional name for output
Attributes
- Supertypes
-
class ForkJoinParallelCpgPass[AnyRef]trait CpgPassBaseclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class SimpleCpgPass
Base trait for all CPG passes. Defines the lifecycle methods that every pass must implement: createAndApply for standalone execution, and runWithBuilder for composing passes that share a single DiffGraphBuilder.
Base trait for all CPG passes. Defines the lifecycle methods that every pass must implement: createAndApply for standalone execution, and runWithBuilder for composing passes that share a single DiffGraphBuilder.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
A parallel CPG pass using the fork/join model.
A parallel CPG pass using the fork/join model.
Instead of returning an Iterator, generateParts returns an Array. This means that the entire collection of parts must live on the heap at the same time; on the other hand, there are no possible issues with iterator invalidation, e.g. when running over all METHOD nodes and deleting some of them.
Instead of streaming writes as ParallelCpgPass do, all runOnPart invocations read the initial state of the graph. Then all changes (accumulated in the DiffGraphBuilders) are merged into a single change, and applied in one go.
In other words, the parallelism follows the fork/join parallel map-reduce (java: collect, scala: aggregate) model. The effect is identical as if one were to sequentially run runOnPart on all output elements of generateParts in sequential order, with the same builder.
This simplifies semantics and makes it easy to reason about possible races.
Note that ForkJoinParallelCpgPass never writes intermediate results, so one must consider peak memory consumption when porting from ParallelCpgPass.
Initialization and cleanup of external resources or large datastructures can be done in the init and finish methods. This may be better than using the constructor or GC, because e.g. SCPG chains of passes construct passes eagerly, and releases them only when the entire chain has run.
This is a simplified form of ForkJoinParallelCpgPassWithAccumulator that does not use an accumulator.
Type parameters
- T
-
the type of each part produced by generateParts
Value parameters
- cpg
-
the code property graph to modify
- outname
-
optional output name
Attributes
- Supertypes
- Known subtypes
-
class CpgPassclass SimpleCpgPass
A parallel CPG pass with an accumulator for aggregating side results.
A parallel CPG pass with an accumulator for aggregating side results.
This is the most general form of the fork/join pass framework. It extends ForkJoinParallelCpgPass with an accumulator of type Accumulator that each parallel worker maintains locally. After all parts are processed, worker accumulators are merged via mergeAccumulator, and the final merged accumulator is passed to onAccumulatorComplete where additional graph changes can be recorded.
Type parameters
- Accumulator
-
the type of the accumulator used during parallel execution
- T
-
the type of each part produced by generateParts
Value parameters
- cpg
-
the code property graph to modify
- outName
-
optional output name
Attributes
- Supertypes
- Known subtypes
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Deprecated classlikes
Attributes
- Deprecated
-
Use CpgPass instead.
- Supertypes
-
class CpgPassclass ForkJoinParallelCpgPass[AnyRef]trait CpgPassBaseclass Objecttrait Matchableclass AnyShow all