processSourceGraph

fun processSourceGraph(oldGraph: L2ControlFlowGraph, interestingConditionsByOldBlock: Map<L2BasicBlock, Set<L2SplitCondition>>)

Given an original L2ControlFlowGraph, translate each L2BasicBlock (in topological order), translating each instruction within that block. Since the new graph has essentially the same shape as the original, we don't need to do any special synchronization at merge points. There's no way for a block of the original to be reached before one of its predecessors, and the translation of an instruction can't suddenly jump to a point in the target graph that corresponds with an earlier point in the source graph. Therefore, when we reach a block in the original, we can safely assume that its translation(s) in the target graph have already had their predecessors completely generated.

The client must set up the targetGenerator to be generating at a reachable state, prior to this call.

Parameters

oldGraph

The L2ControlFlowGraph from which to start translation and code generation.

interestingConditionsByOldBlock

A map from each L2BasicBlock in the oldGraph to a set of split conditions, each of which should be preserved for potential use by a downstream block. Create a new L2BasicBlock for each encountered (old block, split set), where the split set is a subset of conditions to be preserved at this old block, and was actually ensured by some regenerated edge.