Class EnhancedUnitGraph

  • All Implemented Interfaces:
    Iterable<Unit>, DirectedBodyGraph<Unit>, DirectedGraph<Unit>

    public class EnhancedUnitGraph
    extends UnitGraph
    This class represents a control flow graph which behaves like an ExceptionalUnitGraph and BriefUnitGraph when there are no exception handling construct in the method; at the presence of such constructs, the CFG is constructed from a brief graph by adding a concise representation of the exceptional flow as well as START/STOP auxiliary nodes. In a nutshell, the exceptional flow is represented at the level of try-catch-finally blocks instead of the Unit level to allow a more useful region analysis.
    Author:
    Hossein Sadat-Mohtasham
    • Constructor Detail

      • EnhancedUnitGraph

        public EnhancedUnitGraph​(Body body)
    • Method Detail

      • handleMultipleReturns

        protected void handleMultipleReturns()
        This method adds a STOP node to the graph, if necessary, to make the CFG single-tailed.
      • removeBogusHeads

        protected void removeBogusHeads()
        This method removes all the heads in the CFG except the one that corresponds to the first unit in the method.
      • handleExplicitThrowEdges

        protected void handleExplicitThrowEdges()
      • addAuxiliaryExceptionalEdges

        protected void addAuxiliaryExceptionalEdges()
        Add an exceptional flow edge for each handler from the corresponding auxiliary nop node to the beginning of the handler.