Class BackwardAnalysisImpl<V extends AbstractValue<V>,S extends Store<S>,T extends BackwardTransferFunction<V,S>>   
java.lang.Object
org.checkerframework.dataflow.analysis.AbstractAnalysis<V,S,T>
  
org.checkerframework.dataflow.analysis.BackwardAnalysisImpl<V,S,T>  
- Type Parameters:
- V- the abstract value type to be tracked by the analysis
- S- the store type used in the analysis
- T- the transfer function type that is used to approximate run-time behavior
- All Implemented Interfaces:
- Analysis<V,,- S, - T> - BackwardAnalysis<V,- S, - T> 
public class BackwardAnalysisImpl<V extends AbstractValue<V>,S extends Store<S>,T extends BackwardTransferFunction<V,S>>   
extends AbstractAnalysis<V,S,T>
implements BackwardAnalysis<V,S,T>    
An implementation of a backward analysis to solve a org.checkerframework.dataflow problem given a
 control flow graph and a backward transfer function.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.checkerframework.dataflow.analysis.AbstractAnalysisAbstractAnalysis.WorklistNested classes/interfaces inherited from interface org.checkerframework.dataflow.analysis.AnalysisAnalysis.BeforeOrAfter, Analysis.Direction
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final IdentityHashMap<ExceptionBlock, S> Exception store of an exception block, propagated by exceptional successors of its exception block, and merged with the normalTransferResult.protected final IdentityHashMap<Block, S> Out stores after every basic block (assumed to be 'no information' if not present).The store right before the entry block.Fields inherited from class org.checkerframework.dataflow.analysis.AbstractAnalysiscfg, currentInput, currentNode, currentTree, direction, finalLocalValues, inputs, isRunning, nodeValues, transferFunction, worklist
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct an object that can perform a org.checkerframework.dataflow backward analysis over a control flow graph.BackwardAnalysisImpl(T transferFunction) Construct an object that can perform a org.checkerframework.dataflow backward analysis over a control flow graph given a transfer function.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddStoreAfter(Block pred, @Nullable Node node, S s, boolean addBlockToWorklist) Add a store after the basic blockpredby merging with the existing stores for that location.Returns the output store at the entry block of a given control flow graph.Returns the transfer input of a givenBlockb.Returns the store corresponding to the location right after the basic blockb.protected voidInitialize fields of this object based on a given control flow graph.protected voidInitialize the transfer inputs of every basic block before performing the analysis.voidPerform the actual analysis.voidPerform the actual analysis on one block.protected voidpropagateStoresTo(Block pred, @Nullable Node node, TransferInput<V, S> currentInput, Store.FlowRule flowRule, boolean addToWorklistAgain) Propagate the stores incurrentInputto the next block in the direction of analysis, according to theflowRule.runAnalysisFor(Node node, Analysis.BeforeOrAfter preOrPost, TransferInput<V, S> blockTransferInput, IdentityHashMap<Node, V> nodeValues, @Nullable Map<TransferInput<V, S>, IdentityHashMap<Node, TransferResult<V, S>>> analysisCaches) Runs the analysis again within the block ofnodeand returns the store at the location ofnode.Methods inherited from class org.checkerframework.dataflow.analysis.AbstractAnalysisaddToWorklist, callTransferFunction, getContainingClass, getContainingMethod, getCurrentTree, getDirection, getEnclosingClass, getEnclosingMethod, getExceptionalExitStore, getNodesForTree, getNodeValues, getRegularExitStore, getResult, getTransferFunction, getValue, getValue, init, isIgnoredExceptionType, isRunning, setCurrentNode, setCurrentTree, updateNodeValuesMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.checkerframework.dataflow.analysis.AnalysisgetDirection, getExceptionalExitStore, getRegularExitStore, getResult, getTransferFunction, getValue, getValue, isRunning
- 
Field Details- 
outStoresOut stores after every basic block (assumed to be 'no information' if not present).
- 
exceptionStoresException store of an exception block, propagated by exceptional successors of its exception block, and merged with the normalTransferResult.
- 
storeAtEntryThe store right before the entry block.
 
- 
- 
Constructor Details- 
BackwardAnalysisImplpublic BackwardAnalysisImpl()Construct an object that can perform a org.checkerframework.dataflow backward analysis over a control flow graph. When using this constructor, the transfer function is set later by the subclass, e.g.,org.checkerframework.framework.flow.CFAbstractAnalysis.
- 
BackwardAnalysisImplConstruct an object that can perform a org.checkerframework.dataflow backward analysis over a control flow graph given a transfer function.- Parameters:
- transferFunction- the transfer function
 
 
- 
- 
Method Details- 
performAnalysisDescription copied from interface:AnalysisPerform the actual analysis.- Specified by:
- performAnalysisin interface- Analysis<V extends AbstractValue<V>,- S extends Store<S>, - T extends BackwardTransferFunction<V, - S>> 
- Parameters:
- cfg- the control flow graph
 
- 
performAnalysisBlockDescription copied from interface:AnalysisPerform the actual analysis on one block.- Specified by:
- performAnalysisBlockin interface- Analysis<V extends AbstractValue<V>,- S extends Store<S>, - T extends BackwardTransferFunction<V, - S>> 
- Parameters:
- b- the block to analyze
 
- 
getInputDescription copied from interface:AnalysisReturns the transfer input of a givenBlockb.
- 
getEntryStoreDescription copied from interface:BackwardAnalysisReturns the output store at the entry block of a given control flow graph. For a backward analysis, the output store contains the analyzed flow information from the exit block to the entry block.- Specified by:
- getEntryStorein interface- BackwardAnalysis<V extends AbstractValue<V>,- S extends Store<S>, - T extends BackwardTransferFunction<V, - S>> 
- Returns:
- the output store at the entry block of a given control flow graph
 
- 
initFieldsDescription copied from class:AbstractAnalysisInitialize fields of this object based on a given control flow graph. Sub-class may override this method to initialize customized fields.- Overrides:
- initFieldsin class- AbstractAnalysis<V extends AbstractValue<V>,- S extends Store<S>, - T extends BackwardTransferFunction<V, - S>> 
- Parameters:
- cfg- a given control flow graph
 
- 
initInitialInputsDescription copied from class:AbstractAnalysisInitialize the transfer inputs of every basic block before performing the analysis.- Specified by:
- initInitialInputsin class- AbstractAnalysis<V extends AbstractValue<V>,- S extends Store<S>, - T extends BackwardTransferFunction<V, - S>> 
 
- 
propagateStoresToprotected void propagateStoresTo(Block pred, @Nullable Node node, TransferInput<V, S> currentInput, Store.FlowRule flowRule, boolean addToWorklistAgain) Description copied from class:AbstractAnalysisPropagate the stores incurrentInputto the next block in the direction of analysis, according to theflowRule.- Specified by:
- propagateStoresToin class- AbstractAnalysis<V extends AbstractValue<V>,- S extends Store<S>, - T extends BackwardTransferFunction<V, - S>> 
- Parameters:
- pred- the target block to propagate the stores to
- node- the node of the target block
- currentInput- the current transfer input
- flowRule- the flow rule being used
- addToWorklistAgain- true if the block should be added to- AbstractAnalysis.worklistagain
 
- 
addStoreAfterAdd a store after the basic blockpredby merging with the existing stores for that location.- Parameters:
- pred- the basic block
- node- the node of the basic block- b
- s- the store being added
- addBlockToWorklist- true if the basic block- bshould be added back to- Worklist
 
- 
getStoreAfterReturns the store corresponding to the location right after the basic blockb.- Parameters:
- b- the given block
- Returns:
- the store right after the given block
 
- 
runAnalysisForpublic S runAnalysisFor(@FindDistinct Node node, Analysis.BeforeOrAfter preOrPost, TransferInput<V, S> blockTransferInput, IdentityHashMap<Node, V> nodeValues, @Nullable Map<TransferInput<V, S>, IdentityHashMap<Node, TransferResult<V, S>>> analysisCaches) Description copied from interface:AnalysisRuns the analysis again within the block ofnodeand returns the store at the location ofnode. Ifbeforeis true, then the store immediately before theNodenodeis returned. Otherwise, the store immediately afternodeis returned.- Specified by:
- runAnalysisForin interface- Analysis<V extends AbstractValue<V>,- S extends Store<S>, - T extends BackwardTransferFunction<V, - S>> 
- Parameters:
- node- the node to analyze
- preOrPost- which store to return: the store immediately before- nodeor the store after- node
- blockTransferInput- the transfer input of the block of this node
- nodeValues- abstract values of nodes
- analysisCaches- caches of analysis results. If it is not null, this method uses and updates it. It is a map from a TransferInput for a Block to a map. The inner map is from from a node within the block to a TransferResult.
- Returns:
- the store before or after node(depends on the value ofbefore) after running the analysis
 
 
-