private BasicBlock buildExitBasicBlock ( Stack < ExceptionRegion > nestedExceptionRegions , BasicBlock firstBB , List < BasicBlock > returnBBs , List < BasicBlock > exceptionBBs , boolean nextIsFallThrough , BasicBlock currBB , BasicBlock entryBB ) { exitBB = createBB ( nestedExceptionRegions ) ; graph . addEdge ( entryBB , exitBB , EdgeType . EXIT ) ; graph . addEdge ( entryBB , firstBB , EdgeType . FALL_THROUGH ) ; for ( BasicBlock rb : returnBBs ) { graph . addEdge ( rb , exitBB , EdgeType . EXIT ) ; } for ( BasicBlock rb : exceptionBBs ) { graph . addEdge ( rb , exitBB , EdgeType . EXIT ) ; } if ( nextIsFallThrough ) graph . addEdge ( currBB , exitBB , EdgeType . EXIT ) ; return exitBB ; }
Create special empty exit BasicBlock that all BasicBlocks will eventually flow into . All Edges to this dummy BasicBlock will get marked with an edge type of EXIT .