Class ValueTransfer
java.lang.Object
org.checkerframework.dataflow.cfg.node.AbstractNodeVisitor<TransferResult<V,S>,TransferInput<V,S>>
org.checkerframework.framework.flow.CFAbstractTransfer<CFValue,CFStore,CFTransfer>
org.checkerframework.framework.flow.CFTransfer
org.checkerframework.common.value.ValueTransfer
- All Implemented Interfaces:
ForwardTransferFunction<CFValue,
,CFStore> TransferFunction<CFValue,
,CFStore> NodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
The transfer class for the Value Checker.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ValueAnnotatedTypeFactory
The Value type factory.protected final QualifierHierarchy
The Value qualifier hierarchy.Fields inherited from class org.checkerframework.framework.flow.CFAbstractTransfer
analysis, sequentialSemantics
-
Constructor Summary
ConstructorDescriptionValueTransfer
(CFAbstractAnalysis<CFValue, CFStore, CFTransfer> analysis) Create a new ValueTransfer. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
processConditionalPostconditions
(MethodInvocationNode n, ExecutableElement methodElement, ExpressionTree tree, CFStore thenStore, CFStore elseStore) Add information from the conditional postconditions of a method to the stores after an invocation.protected TransferResult<CFValue,
CFStore> strengthenAnnotationOfEqualTo
(TransferResult<CFValue, CFStore> transferResult, Node firstNode, Node secondNode, CFValue firstValue, CFValue secondValue, boolean notEqualTo) Refine the annotation ofsecondNode
if the annotationsecondValue
is less precise thanfirstValue
.stringConcatenation
(Node leftOperand, Node rightOperand, TransferInput<CFValue, CFStore> p, TransferResult<CFValue, CFStore> result) Reverse the role of the 'thenStore' and 'elseStore'.visitFieldAccess
(FieldAccessNode node, TransferInput<CFValue, CFStore> in) Methods inherited from class org.checkerframework.framework.flow.CFAbstractTransfer
addInformationFromPreconditions, createTransferResult, createTransferResult, finishValue, finishValue, getNarrowedValue, getValueFromFactory, getWidenedValue, initialStore, insertIntoStores, isNotFullyInitializedReceiver, moreSpecificValue, processCommonAssignment, processPostconditions, recreateTransferResult, recreateTransferResult, setFixedInitialStore, shouldPerformWholeProgramInference, shouldPerformWholeProgramInference, splitAssignments, usesSequentialSemantics, visitArrayAccess, visitAssignment, visitCase, visitClassName, visitDeconstructorPattern, visitExpressionStatement, visitInstanceOf, visitLambdaResultExpression, visitLocalVariable, visitNarrowingConversion, visitNode, visitObjectCreation, visitReturn, visitStringConversion, visitSwitchExpressionNode, visitTernaryExpression, visitThis, visitVariableDeclaration, visitWideningConversion
Methods inherited from class org.checkerframework.dataflow.cfg.node.AbstractNodeVisitor
visitArrayCreation, visitArrayType, visitAssertionError, visitBooleanLiteral, visitCharacterLiteral, visitClassDeclaration, visitDoubleLiteral, visitExplicitThis, visitFloatLiteral, visitImplicitThis, visitIntegerLiteral, visitLongLiteral, visitMarker, visitMemberReference, visitMethodAccess, visitNullChk, visitNullLiteral, visitPackageName, visitParameterizedType, visitPrimitiveType, visitShortLiteral, visitStringLiteral, visitSuper, visitSynchronized, visitThrow, visitTypeCast, visitValueLiteral
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.checkerframework.dataflow.cfg.node.NodeVisitor
visitArrayCreation, visitArrayType, visitAssertionError, visitBooleanLiteral, visitCharacterLiteral, visitClassDeclaration, visitDoubleLiteral, visitExplicitThis, visitFloatLiteral, visitImplicitThis, visitIntegerLiteral, visitLongLiteral, visitMarker, visitMemberReference, visitMethodAccess, visitNullChk, visitNullLiteral, visitPackageName, visitParameterizedType, visitPrimitiveType, visitShortLiteral, visitStringLiteral, visitSuper, visitSynchronized, visitThrow, visitTypeCast
-
Field Details
-
atypeFactory
The Value type factory. -
qualHierarchy
The Value qualifier hierarchy.
-
-
Constructor Details
-
ValueTransfer
Create a new ValueTransfer.- Parameters:
analysis
- the corresponding analysis
-
-
Method Details
-
visitFieldAccess
public TransferResult<CFValue,CFStore> visitFieldAccess(FieldAccessNode node, TransferInput<CFValue, CFStore> in) - Specified by:
visitFieldAccess
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitFieldAccess
in classCFAbstractTransfer<CFValue,
CFStore, CFTransfer>
-
visitMethodInvocation
public TransferResult<CFValue,CFStore> visitMethodInvocation(MethodInvocationNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitMethodInvocation
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitMethodInvocation
in classCFAbstractTransfer<CFValue,
CFStore, CFTransfer>
-
visitStringConcatenate
public TransferResult<CFValue,CFStore> visitStringConcatenate(StringConcatenateNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitStringConcatenate
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitStringConcatenate
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
stringConcatenation
public TransferResult<CFValue,CFStore> stringConcatenation(Node leftOperand, Node rightOperand, TransferInput<CFValue, CFStore> p, TransferResult<CFValue, CFStore> result) -
visitNumericalAddition
public TransferResult<CFValue,CFStore> visitNumericalAddition(NumericalAdditionNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitNumericalAddition
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitNumericalAddition
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitNumericalSubtraction
public TransferResult<CFValue,CFStore> visitNumericalSubtraction(NumericalSubtractionNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitNumericalSubtraction
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitNumericalSubtraction
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitNumericalMultiplication
public TransferResult<CFValue,CFStore> visitNumericalMultiplication(NumericalMultiplicationNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitNumericalMultiplication
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitNumericalMultiplication
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitIntegerDivision
public TransferResult<CFValue,CFStore> visitIntegerDivision(IntegerDivisionNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitIntegerDivision
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitIntegerDivision
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitFloatingDivision
public TransferResult<CFValue,CFStore> visitFloatingDivision(FloatingDivisionNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitFloatingDivision
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitFloatingDivision
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitIntegerRemainder
public TransferResult<CFValue,CFStore> visitIntegerRemainder(IntegerRemainderNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitIntegerRemainder
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitIntegerRemainder
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitFloatingRemainder
public TransferResult<CFValue,CFStore> visitFloatingRemainder(FloatingRemainderNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitFloatingRemainder
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitFloatingRemainder
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitLeftShift
public TransferResult<CFValue,CFStore> visitLeftShift(LeftShiftNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitLeftShift
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitLeftShift
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitSignedRightShift
public TransferResult<CFValue,CFStore> visitSignedRightShift(SignedRightShiftNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitSignedRightShift
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitSignedRightShift
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitUnsignedRightShift
public TransferResult<CFValue,CFStore> visitUnsignedRightShift(UnsignedRightShiftNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitUnsignedRightShift
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitUnsignedRightShift
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitBitwiseAnd
public TransferResult<CFValue,CFStore> visitBitwiseAnd(BitwiseAndNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitBitwiseAnd
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitBitwiseAnd
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitBitwiseOr
public TransferResult<CFValue,CFStore> visitBitwiseOr(BitwiseOrNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitBitwiseOr
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitBitwiseOr
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitBitwiseXor
public TransferResult<CFValue,CFStore> visitBitwiseXor(BitwiseXorNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitBitwiseXor
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitBitwiseXor
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitNumericalMinus
public TransferResult<CFValue,CFStore> visitNumericalMinus(NumericalMinusNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitNumericalMinus
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitNumericalMinus
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitNumericalPlus
public TransferResult<CFValue,CFStore> visitNumericalPlus(NumericalPlusNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitNumericalPlus
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitNumericalPlus
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitBitwiseComplement
public TransferResult<CFValue,CFStore> visitBitwiseComplement(BitwiseComplementNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitBitwiseComplement
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitBitwiseComplement
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitLessThan
public TransferResult<CFValue,CFStore> visitLessThan(LessThanNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitLessThan
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitLessThan
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitLessThanOrEqual
public TransferResult<CFValue,CFStore> visitLessThanOrEqual(LessThanOrEqualNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitLessThanOrEqual
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitLessThanOrEqual
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitGreaterThan
public TransferResult<CFValue,CFStore> visitGreaterThan(GreaterThanNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitGreaterThan
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitGreaterThan
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitGreaterThanOrEqual
public TransferResult<CFValue,CFStore> visitGreaterThanOrEqual(GreaterThanOrEqualNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitGreaterThanOrEqual
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitGreaterThanOrEqual
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
strengthenAnnotationOfEqualTo
protected TransferResult<CFValue,CFStore> strengthenAnnotationOfEqualTo(TransferResult<CFValue, CFStore> transferResult, Node firstNode, Node secondNode, CFValue firstValue, CFValue secondValue, boolean notEqualTo) Description copied from class:CFAbstractTransfer
Refine the annotation ofsecondNode
if the annotationsecondValue
is less precise thanfirstValue
. This is possible, ifsecondNode
is an expression that is tracked by the store (e.g., a local variable or a field). Clients usually call this twice withfirstNode
andsecondNode
reversed, to refine each of them.Note that when overriding this method, when a new type is inserted into the store,
CFAbstractTransfer.splitAssignments(org.checkerframework.dataflow.cfg.node.Node)
should be called, and the new type should be inserted into the store for each of the resulting nodes.- Overrides:
strengthenAnnotationOfEqualTo
in classCFAbstractTransfer<CFValue,
CFStore, CFTransfer> - Parameters:
transferResult
- the previous resultfirstNode
- the node that might be more precisesecondNode
- the node whose type to possibly refinefirstValue
- the abstract value that might be more precisesecondValue
- the abstract value that might be less precisenotEqualTo
- if true, indicates that the logic is flipped (i.e., the information is added to theelseStore
instead of thethenStore
) for a not-equal comparison.- Returns:
- the conditional transfer result (if information has been added), or
res
-
processConditionalPostconditions
protected void processConditionalPostconditions(MethodInvocationNode n, ExecutableElement methodElement, ExpressionTree tree, CFStore thenStore, CFStore elseStore) Description copied from class:CFAbstractTransfer
Add information from the conditional postconditions of a method to the stores after an invocation.- Overrides:
processConditionalPostconditions
in classCFAbstractTransfer<CFValue,
CFStore, CFTransfer> - Parameters:
n
- a method callmethodElement
- the method being calledtree
- the tree for the method callthenStore
- the "then" store; is side-effected by this methodelseStore
- the "else" store; is side-effected by this method
-
visitEqualTo
public TransferResult<CFValue,CFStore> visitEqualTo(EqualToNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitEqualTo
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitEqualTo
in classCFAbstractTransfer<CFValue,
CFStore, CFTransfer>
-
visitNotEqual
public TransferResult<CFValue,CFStore> visitNotEqual(NotEqualNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitNotEqual
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitNotEqual
in classCFAbstractTransfer<CFValue,
CFStore, CFTransfer>
-
visitConditionalNot
public TransferResult<CFValue,CFStore> visitConditionalNot(ConditionalNotNode n, TransferInput<CFValue, CFStore> p) Description copied from class:CFAbstractTransfer
Reverse the role of the 'thenStore' and 'elseStore'.- Specified by:
visitConditionalNot
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitConditionalNot
in classCFAbstractTransfer<CFValue,
CFStore, CFTransfer>
-
visitConditionalAnd
public TransferResult<CFValue,CFStore> visitConditionalAnd(ConditionalAndNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitConditionalAnd
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitConditionalAnd
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-
visitConditionalOr
public TransferResult<CFValue,CFStore> visitConditionalOr(ConditionalOrNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitConditionalOr
in interfaceNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitConditionalOr
in classAbstractNodeVisitor<TransferResult<CFValue,
CFStore>, TransferInput<CFValue, CFStore>>
-