Class ValueTransfer
java.lang.Object
org.checkerframework.dataflow.cfg.node.AbstractNodeVisitor<TransferResult<CFValue,CFStore>,TransferInput<CFValue,CFStore>>
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
FieldsModifier and TypeFieldDescriptionprotected final ValueAnnotatedTypeFactoryThe Value type factory.protected final QualifierHierarchyThe Value qualifier hierarchy.Fields inherited from class org.checkerframework.framework.flow.CFAbstractTransfer
analysis, sequentialSemantics -
Constructor Summary
ConstructorsConstructorDescriptionValueTransfer(CFAbstractAnalysis<CFValue, CFStore, CFTransfer> analysis) Create a new ValueTransfer. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprocessConditionalPostconditions(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 ofsecondNodeif the annotationsecondValueis 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, insertIntoStoresPermitNonDeterministic, isNotFullyInitializedReceiver, moreSpecificValue, processCommonAssignment, processPostconditions, recreateTransferResult, recreateTransferResult, setFixedInitialStore, shouldPerformWholeProgramInference, shouldPerformWholeProgramInference, splitAssignments, usesSequentialSemantics, visitAnyPattern, visitArrayAccess, visitAssignment, visitCase, visitClassName, visitDeconstructorPattern, visitExpressionStatement, visitInstanceOf, visitLambdaResultExpression, visitLocalVariable, visitNarrowingConversion, visitNode, visitObjectCreation, visitReturn, visitStringConversion, visitSwitchExpressionNode, visitTernaryExpression, visitThis, visitVariableDeclaration, visitWideningConversionMethods 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, visitValueLiteralMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
visitFieldAccessin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitFieldAccessin classCFAbstractTransfer<CFValue,CFStore, CFTransfer>
-
visitMethodInvocation
public TransferResult<CFValue,CFStore> visitMethodInvocation(MethodInvocationNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitMethodInvocationin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitMethodInvocationin classCFAbstractTransfer<CFValue,CFStore, CFTransfer>
-
visitStringConcatenate
public TransferResult<CFValue,CFStore> visitStringConcatenate(StringConcatenateNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitStringConcatenatein interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitStringConcatenatein 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:
visitNumericalAdditionin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitNumericalAdditionin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitNumericalSubtraction
public TransferResult<CFValue,CFStore> visitNumericalSubtraction(NumericalSubtractionNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitNumericalSubtractionin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitNumericalSubtractionin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitNumericalMultiplication
public TransferResult<CFValue,CFStore> visitNumericalMultiplication(NumericalMultiplicationNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitNumericalMultiplicationin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitNumericalMultiplicationin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitIntegerDivision
public TransferResult<CFValue,CFStore> visitIntegerDivision(IntegerDivisionNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitIntegerDivisionin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitIntegerDivisionin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitFloatingDivision
public TransferResult<CFValue,CFStore> visitFloatingDivision(FloatingDivisionNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitFloatingDivisionin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitFloatingDivisionin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitIntegerRemainder
public TransferResult<CFValue,CFStore> visitIntegerRemainder(IntegerRemainderNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitIntegerRemainderin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitIntegerRemainderin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitFloatingRemainder
public TransferResult<CFValue,CFStore> visitFloatingRemainder(FloatingRemainderNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitFloatingRemainderin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitFloatingRemainderin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitLeftShift
public TransferResult<CFValue,CFStore> visitLeftShift(LeftShiftNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitLeftShiftin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitLeftShiftin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitSignedRightShift
public TransferResult<CFValue,CFStore> visitSignedRightShift(SignedRightShiftNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitSignedRightShiftin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitSignedRightShiftin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitUnsignedRightShift
public TransferResult<CFValue,CFStore> visitUnsignedRightShift(UnsignedRightShiftNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitUnsignedRightShiftin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitUnsignedRightShiftin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitBitwiseAnd
public TransferResult<CFValue,CFStore> visitBitwiseAnd(BitwiseAndNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitBitwiseAndin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitBitwiseAndin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitBitwiseOr
public TransferResult<CFValue,CFStore> visitBitwiseOr(BitwiseOrNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitBitwiseOrin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitBitwiseOrin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitBitwiseXor
public TransferResult<CFValue,CFStore> visitBitwiseXor(BitwiseXorNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitBitwiseXorin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitBitwiseXorin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitNumericalMinus
public TransferResult<CFValue,CFStore> visitNumericalMinus(NumericalMinusNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitNumericalMinusin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitNumericalMinusin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitNumericalPlus
public TransferResult<CFValue,CFStore> visitNumericalPlus(NumericalPlusNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitNumericalPlusin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitNumericalPlusin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitBitwiseComplement
public TransferResult<CFValue,CFStore> visitBitwiseComplement(BitwiseComplementNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitBitwiseComplementin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitBitwiseComplementin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitLessThan
public TransferResult<CFValue,CFStore> visitLessThan(LessThanNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitLessThanin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitLessThanin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitLessThanOrEqual
public TransferResult<CFValue,CFStore> visitLessThanOrEqual(LessThanOrEqualNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitLessThanOrEqualin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitLessThanOrEqualin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitGreaterThan
public TransferResult<CFValue,CFStore> visitGreaterThan(GreaterThanNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitGreaterThanin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitGreaterThanin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitGreaterThanOrEqual
public TransferResult<CFValue,CFStore> visitGreaterThanOrEqual(GreaterThanOrEqualNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitGreaterThanOrEqualin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitGreaterThanOrEqualin 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:CFAbstractTransferRefine the annotation ofsecondNodeif the annotationsecondValueis less precise thanfirstValue. This is possible, ifsecondNodeis an expression that is tracked by the store (e.g., a local variable or a field). Clients usually call this twice withfirstNodeandsecondNodereversed, 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:
strengthenAnnotationOfEqualToin 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 theelseStoreinstead 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:CFAbstractTransferAdd information from the conditional postconditions of a method to the stores after an invocation.- Overrides:
processConditionalPostconditionsin 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:
visitEqualToin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitEqualToin classCFAbstractTransfer<CFValue,CFStore, CFTransfer>
-
visitNotEqual
public TransferResult<CFValue,CFStore> visitNotEqual(NotEqualNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitNotEqualin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitNotEqualin classCFAbstractTransfer<CFValue,CFStore, CFTransfer>
-
visitConditionalNot
public TransferResult<CFValue,CFStore> visitConditionalNot(ConditionalNotNode n, TransferInput<CFValue, CFStore> p) Description copied from class:CFAbstractTransferReverse the role of the 'thenStore' and 'elseStore'.- Specified by:
visitConditionalNotin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitConditionalNotin classCFAbstractTransfer<CFValue,CFStore, CFTransfer>
-
visitConditionalAnd
public TransferResult<CFValue,CFStore> visitConditionalAnd(ConditionalAndNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitConditionalAndin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitConditionalAndin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-
visitConditionalOr
public TransferResult<CFValue,CFStore> visitConditionalOr(ConditionalOrNode n, TransferInput<CFValue, CFStore> p) - Specified by:
visitConditionalOrin interfaceNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>> - Overrides:
visitConditionalOrin classAbstractNodeVisitor<TransferResult<CFValue,CFStore>, TransferInput<CFValue, CFStore>>
-