accrue.analysis.interprocanalysis

## Class PreciseDataFlow<FlowItem extends polyglot.visit.DataFlow.Item>

- java.lang.Object
- - polyglot.visit.NodeVisitor
  - - polyglot.visit.HaltingVisitor
    - - polyglot.visit.ErrorHandlingVisitor
      - - polyglot.visit.DataFlow<FlowItem>
        - - accrue.analysis.interprocanalysis.PreciseDataFlow<FlowItem>

- Type Parameters:
    `FlowItem` - The DataFlow.Item that the dataflow propagates
  All Implemented Interfaces:
    java.lang.Cloneable, polyglot.util.Copy<polyglot.visit.NodeVisitor>
  Direct Known Subclasses:
    CtlDepDataFlow, DominatorDataFlow, PostDominatorDataFlow, VarContextDataFlow

      public abstract class PreciseDataFlow<FlowItem extends polyglot.visit.DataFlow.Item>
      extends polyglot.visit.DataFlow<FlowItem>

  Uses the results of precise exceptions analysis to create a more accurate control flow graph. Any analysis pass that uses PreciseDataFlow to perform analysis should have as a prerequisite the goal AnalysisScheduler.PreciseExceptionAnalysis(2). This will run 2 passes of the PreciseExceptions pass, as well as a NotNullAnalysisPass, and use the results to produce a more accurate control flow graph.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `PreciseDataFlow.PreciseCFGBuilder<FlowItem extends polyglot.visit.DataFlow.Item>` A more precise CFG builder that adds Exception edges only for exceptions that might actually be thrown.

    - ### Nested classes/interfaces inherited from class polyglot.visit.DataFlow

      `polyglot.visit.DataFlow.BoolItem<FlowItem extends polyglot.visit.DataFlow.Item>, polyglot.visit.DataFlow.ConditionNavigator<FlowItem extends polyglot.visit.DataFlow.Item>, polyglot.visit.DataFlow.FlowGraphSource<FlowItem extends polyglot.visit.DataFlow.Item>, polyglot.visit.DataFlow.Frame<FlowItem extends polyglot.visit.DataFlow.Item>, polyglot.visit.DataFlow.Item`

    - ### Nested classes/interfaces inherited from interface polyglot.util.Copy

      `polyglot.util.Copy.Util`

  - ### Field Summary

    - ### Fields inherited from class polyglot.visit.DataFlow

      `dataflowOnEntry, detectBackEdges, flowCounter, flowgraphStack, forward, postordering`

    - ### Fields inherited from class polyglot.visit.ErrorHandlingVisitor

      `error, job, nf, ts`

    - ### Fields inherited from class polyglot.visit.HaltingVisitor

      `bypass, bypassParent`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PreciseDataFlow(AnalysisUtil<?> autil, polyglot.frontend.Job job, polyglot.types.TypeSystem ts, polyglot.ast.NodeFactory nf, boolean forward)` Create a new dataflow visitor
    `PreciseDataFlow(AnalysisUtil<?> autil, polyglot.frontend.Job job, polyglot.types.TypeSystem ts, polyglot.ast.NodeFactory nf, boolean forward, boolean dataflowOnEntry)` Create a new dataflow visitor
    `PreciseDataFlow(AnalysisUtil<?> autil, polyglot.frontend.Job job, polyglot.types.TypeSystem ts, polyglot.ast.NodeFactory nf, boolean forward, boolean dataflowOnEntry, boolean trackBackEdges)` Create a new dataflow visitor

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected AnalysisUtil<?>` | `autil()`
    `protected polyglot.visit.CFGBuilder<FlowItem>` | `createCFGBuilder(polyglot.types.TypeSystem ts, polyglot.visit.FlowGraph<FlowItem> g)`
    `AnalysisContext` | `currentContext()`
    `protected DataFlowNodeIdentifier` | `dataFlowNodeIdentifierForPeer(polyglot.visit.FlowGraph.Peer<FlowItem> peer)` Get the dataflow identifier object for the given flowgraph peer
    `protected static <FlowItem extends polyglot.visit.DataFlow.Item> DataFlowNodeIdentifier` | `dataFlowNodeIdentifierForPeer(polyglot.visit.FlowGraph.Peer<FlowItem> peer, AnalysisContext currentContext)` Get the dataflow identifier object for the given flowgraph peer in the given context
    `protected polyglot.visit.FlowGraph<FlowItem>` | `initGraph(polyglot.ast.CodeNode code, polyglot.ast.Term root)`
    `protected static <FlowItem extends polyglot.visit.DataFlow.Item> polyglot.visit.FlowGraph.Peer<FlowItem>` | `peerForDataFlowNodeIdentifier(DataFlowNodeIdentifier bi, polyglot.visit.FlowGraph<FlowItem> graph)` Get the flowgraph peer for the given dataflow identifier

    - ### Methods inherited from class polyglot.visit.DataFlow

      `check, check, confluence, confluence, constructItemsFromCondition, createFrame, createInitialItem, createInitialItem, currentFlowGraph, dataflow, dataflow, dataflow, dumpFlowGraph, enterCall, filterItems, filterItemsExceptionSubclass, filterItemsNonError, filterItemsNonException, findSCCs, flow, flow, flow, flow, flow, flowBooleanConditions, flowToBooleanFlow, hasTrueFalseBranches, initGraph, itemsToMap, itemToMap, lang, leave, leaveCall, post, safeConfluence, safeConfluence, safeConfluence`

    - ### Methods inherited from class polyglot.visit.ErrorHandlingVisitor

      `begin, catchErrors, enter, enterCall, enterError, errorQueue, hasErrors, job, leaveCall, leaveCall, nodeFactory, typeSystem`

    - ### Methods inherited from class polyglot.visit.HaltingVisitor

      `bypass, bypass, bypassChildren, override, visitChildren`

    - ### Methods inherited from class polyglot.visit.NodeVisitor

      `copy, enter, finish, finish, leave, override, toString, visitEdge, visitEdgeNoOverride`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### PreciseDataFlow

          public PreciseDataFlow(AnalysisUtil<?> autil,
                         polyglot.frontend.Job job,
                         polyglot.types.TypeSystem ts,
                         polyglot.ast.NodeFactory nf,
                         boolean forward)

      Create a new dataflow visitor
      Parameters:
        `autil` - Analysis helper class
        `job` - Polyglot compiler `Job`
        `ts` - Polyglot type system
        `nf` - factory for creating AST nodes
        `forward` - forward or backward dataflow

    - #### PreciseDataFlow

          public PreciseDataFlow(AnalysisUtil<?> autil,
                         polyglot.frontend.Job job,
                         polyglot.types.TypeSystem ts,
                         polyglot.ast.NodeFactory nf,
                         boolean forward,
                         boolean dataflowOnEntry)

      Create a new dataflow visitor
      Parameters:
        `context` - Initial analysis context
        `autil` - Analysis helper class
        `job` - Polyglot compiler `Job`
        `ts` - Polyglot type system
        `nf` - factory for creating AST nodes
        `forward` - forward or backward dataflow
        `dataflowOnEntry` - true if we want to process the entry node

    - #### PreciseDataFlow

          public PreciseDataFlow(AnalysisUtil<?> autil,
                         polyglot.frontend.Job job,
                         polyglot.types.TypeSystem ts,
                         polyglot.ast.NodeFactory nf,
                         boolean forward,
                         boolean dataflowOnEntry,
                         boolean trackBackEdges)

      Create a new dataflow visitor
      Parameters:
        `autil` - Analysis helper class
        `job` - Polyglot compiler `Job`
        `ts` - Polyglot type system
        `nf` - factory for creating AST nodes
        `forward` - forward or backward dataflow
        `dataflowOnEntry` - true if we want to process the entry node
        `trackBackEdges` - true if the dataflow tracks backward flowgraph edges

  - ### Method Detail

    - #### createCFGBuilder

          protected polyglot.visit.CFGBuilder<FlowItem> createCFGBuilder(polyglot.types.TypeSystem ts,
                                                             polyglot.visit.FlowGraph<FlowItem> g)

      Overrides:
        `createCFGBuilder` in class `polyglot.visit.DataFlow<FlowItem extends polyglot.visit.DataFlow.Item>`

    - #### initGraph

          protected polyglot.visit.FlowGraph<FlowItem> initGraph(polyglot.ast.CodeNode code,
                                                     polyglot.ast.Term root)

      Overrides:
        `initGraph` in class `polyglot.visit.DataFlow<FlowItem extends polyglot.visit.DataFlow.Item>`

    - #### currentContext

          public AnalysisContext currentContext()

      Returns:
        current procedure analysis context

    - #### autil

          protected AnalysisUtil<?> autil()

      Returns:
        the analysis helper class

    - #### dataFlowNodeIdentifierForPeer

          protected DataFlowNodeIdentifier dataFlowNodeIdentifierForPeer(polyglot.visit.FlowGraph.Peer<FlowItem> peer)

      Get the dataflow identifier object for the given flowgraph peer
      Parameters:
        `peer` - flowgraph peer
      Returns:
        dataflow identifier

    - #### dataFlowNodeIdentifierForPeer

          protected static <FlowItem extends polyglot.visit.DataFlow.Item> DataFlowNodeIdentifier dataFlowNodeIdentifierForPeer(polyglot.visit.FlowGraph.Peer<FlowItem> peer,
                                                                                                             AnalysisContext currentContext)

      Get the dataflow identifier object for the given flowgraph peer in the given context
      Parameters:
        `peer` - flowgraph peer
        `currentContext` - current analysis context
      Returns:
        dataflow identifier

    - #### peerForDataFlowNodeIdentifier

          protected static <FlowItem extends polyglot.visit.DataFlow.Item> polyglot.visit.FlowGraph.Peer<FlowItem> peerForDataFlowNodeIdentifier(DataFlowNodeIdentifier bi,
                                                                                                                              polyglot.visit.FlowGraph<FlowItem> graph)

      Get the flowgraph peer for the given dataflow identifier
      Parameters:
        `bi` - dataflow identifier
        `graph` - dataflow graph
      Returns:
        flowgraph peer