Class ValueAnalysis
java.lang.Object
org.checkerframework.dataflow.analysis.AbstractAnalysis<CFValue,CFStore,CFTransfer>
org.checkerframework.dataflow.analysis.ForwardAnalysisImpl<CFValue,CFStore,CFTransfer>
org.checkerframework.framework.flow.CFAbstractAnalysis<CFValue,CFStore,CFTransfer>
org.checkerframework.framework.flow.CFAnalysis
org.checkerframework.common.value.ValueAnalysis
- All Implemented Interfaces:
Analysis<CFValue,,CFStore, CFTransfer> ForwardAnalysis<CFValue,CFStore, CFTransfer>
The dataflow analysis for the Value Checker.
It differs from the default analysis only in that it converts the IntRangeFrom*
annotations, which are aliases that the Index Checker introduces, into the IntRange
annotations that the rest of the Value Checker reasons about. Without this conversion, whether an
abstract value holds an alias or an IntRange would depend on whether the value happens to
have been merged at a control-flow join point.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.checkerframework.framework.flow.CFAbstractAnalysis
CFAbstractAnalysis.FieldInitialValue<V extends CFAbstractValue<V>>Nested classes/interfaces inherited from class org.checkerframework.dataflow.analysis.AbstractAnalysis
AbstractAnalysis.WorklistNested classes/interfaces inherited from interface org.checkerframework.dataflow.analysis.Analysis
Analysis.BeforeOrAfter, Analysis.Direction -
Field Summary
Fields inherited from class org.checkerframework.framework.flow.CFAbstractAnalysis
atypeFactory, checker, dependentTypesHelper, env, fieldValues, qualHierarchy, typeHierarchy, typesFields inherited from class org.checkerframework.dataflow.analysis.ForwardAnalysisImpl
blockCount, elseStores, maxCountBeforeWidening, storesAtReturnStatements, thenStoresFields inherited from class org.checkerframework.dataflow.analysis.AbstractAnalysis
cfg, currentInput, currentNode, currentTree, direction, finalLocalValues, inputs, isRunning, nodeValues, transferFunction, worklist -
Constructor Summary
ConstructorsConstructorDescriptionValueAnalysis(BaseTypeChecker checker, ValueAnnotatedTypeFactory factory) Creates a newValueAnalysis. -
Method Summary
Modifier and TypeMethodDescriptioncreateAbstractValue(AnnotationMirrorSet annotations, TypeMirror underlyingType) Returns an abstract value containing the givenannotationsandunderlyingType.Methods inherited from class org.checkerframework.framework.flow.CFAnalysis
createCopiedStore, createEmptyStoreMethods inherited from class org.checkerframework.framework.flow.CFAbstractAnalysis
callTransferFunction, createAbstractValue, createSingleAnnotationValue, createTransferFunction, getCfValue, getEnv, getFieldInitialValues, getSideEffectsOnlyExpressions, getTypeFactory, getTypeHierarchy, getTypes, performAnalysisMethods inherited from class org.checkerframework.dataflow.analysis.ForwardAnalysisImpl
addStoreBefore, getInput, getInputBefore, getReturnStatementStores, getStoreBefore, initFields, initInitialInputs, performAnalysis, performAnalysisBlock, propagateStoresTo, runAnalysisForMethods inherited from class org.checkerframework.dataflow.analysis.AbstractAnalysis
addToWorklist, getCurrentTree, getDirection, getEnclosingClass, getEnclosingMethod, getExceptionalExitStore, getNodesForTree, getNodeValues, getRegularExitStore, getResult, getStoreAfter, getStoreAfter, getStoreBefore, getStoreBefore, getTransferFunction, getValue, getValue, init, isIgnoredExceptionType, isRunning, setCurrentNode, setCurrentTree, updateNodeValuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.checkerframework.dataflow.analysis.Analysis
getDirection, getExceptionalExitStore, getRegularExitStore, getResult, getTransferFunction, getValue, getValue, isRunning
-
Constructor Details
-
ValueAnalysis
Creates a newValueAnalysis.- Parameters:
checker- the checkerfactory- the type factory
-
-
Method Details
-
createAbstractValue
public @Nullable CFValue createAbstractValue(AnnotationMirrorSet annotations, TypeMirror underlyingType) Returns an abstract value containing the givenannotationsandunderlyingType. Returns null if the annotation set has missing annotations.This conversion bounds an
IntRangeFrom*alias by the maximum value ofunderlyingType, whereasValueQualifierHierarchy.leastUpperBoundQualifiersbounds it byLong.MAX_VALUE. The bound here is the more precise of the two.- Overrides:
createAbstractValuein classCFAnalysis- Parameters:
annotations- the annotations for the result annotated typeunderlyingType- the unannotated type for the result annotated type- Returns:
- an abstract value containing the given
annotationsandunderlyingTypeor null ifannotationsis missing annotations
-