Class CFAbstractTransfer<V extends CFAbstractValue<V>,S extends CFAbstractStore<V,S>,T extends CFAbstractTransfer<V,S,T>>
- All Implemented Interfaces:
ForwardTransferFunction<V,,S> TransferFunction<V,,S> NodeVisitor<TransferResult<V,S>, TransferInput<V, S>>
- Direct Known Subclasses:
AccumulationTransfer,CFTransfer,InitializationTransfer,KeyForTransfer,LockTransfer,NullnessNoInitTransfer
AnnotatedTypeFactory to provide checker-specific logic
to combine types (e.g., what is the type of a string concatenation, given the types of the two
operands) and acts as an abstraction function (e.g., determine the annotations on literals).
Design note: CFAbstractTransfer and its subclasses are supposed to act as transfer functions. But, since the AnnotatedTypeFactory already existed and performed checker-independent type propagation, CFAbstractTransfer delegates work to it instead of duplicating some logic in CFAbstractTransfer. The checker-specific subclasses of CFAbstractTransfer do implement transfer function logic themselves.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CFAbstractAnalysis<V, S, T> The analysis used by this transfer function.protected final booleanShould the analysis use sequential Java semantics (i.e., assume that only one thread is running at all times)? -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCFAbstractTransfer(CFAbstractAnalysis<V, S, T> analysis) Create a CFAbstractTransfer.protectedCFAbstractTransfer(CFAbstractAnalysis<V, S, T> analysis, boolean forceConcurrentSemantics) Constructor that allows forcing concurrent semantics to be on for this instance of CFAbstractTransfer. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddInformationFromPreconditions(S initialStore, AnnotatedTypeFactory factory, UnderlyingAST.CFGMethod methodAst, MethodTree methodDeclTree, ExecutableElement methodElement) Add the information from all the preconditions of a method to the initial store in the method body.protected TransferResult<V, S> createTransferResult(@Nullable V value, TransferInput<V, S> in) Creates a TransferResult.finishValue(@Nullable V value, S store) A hook for subclasses to modify the result of the transfer function.finishValue(@Nullable V value, S thenStore, S elseStore) A hook for subclasses to modify the result of the transfer function.getNarrowedValue(TypeMirror type, @PolyNull V annotatedValue) Returns an abstract value with the giventypeand the annotations fromannotatedValue, adapted for narrowing.protected VgetValueFromFactory(Tree tree, Node node) Returns the abstract value of a non-leaf treetree, as computed by theAnnotatedTypeFactory.getWidenedValue(TypeMirror type, @PolyNull V annotatedValue) Returns an abstract value with the giventypeand the annotations fromannotatedValue, adapted for widening.initialStore(UnderlyingAST underlyingAST, List<LocalVariableNode> parameters) The initial store maps method formal parameters to their currently most refined type.protected static voidinsertIntoStores(TransferResult<CFValue, CFStore> result, JavaExpression target, AnnotationMirror newAnno) Inserts newAnno as the value into all stores (conditional or not) in the result for node.protected final booleanisNotFullyInitializedReceiver(MethodTree methodDeclTree) Returns true if the receiver of a method or constructor might not be fully initialized according toanalysis.atypeFactory.isNotFullyInitializedReceiver(methodDeclTree).moreSpecificValue(V value1, V value2) Returns the abstract value of(value1, value2)that is more specific.protected voidprocessCommonAssignment(TransferInput<V, S> in, Node lhs, Node rhs, S store, V rhsValue) Determine abstract value of right-hand side and update the store accordingly.protected voidprocessConditionalPostconditions(MethodInvocationNode invocationNode, ExecutableElement methodElement, ExpressionTree invocationTree, S thenStore, S elseStore) Add information from the conditional postconditions of a method to the stores after an invocation.protected voidprocessPostconditions(Node invocationNode, S store, ExecutableElement executableElement, ExpressionTree invocationTree) Add information from the postconditions of a method to the store after an invocation.protected TransferResult<V, S> recreateTransferResult(@Nullable V value, TransferResult<V, S> in) Creates a TransferResult just like the given one, but with the given value.voidSet a fixed initial Store.splitAssignments(Node node) Takes a node, and either returns the node itself again (as a singleton list), or if the node is an assignment node, returns the lhs and rhs (where splitAssignments is applied recursively to the rhs -- that is, it is possible that the rhs does not appear in the result, but rather its lhs and rhs do).protected TransferResult<V, S> strengthenAnnotationOfEqualTo(TransferResult<V, S> res, Node firstNode, Node secondNode, V firstValue, V secondValue, boolean notEqualTo) Refine the annotation ofsecondNodeif the annotationsecondValueis less precise thanfirstValue.booleanReturns true if the transfer function uses sequential semantics, false if it uses concurrent semantics.visitAssignment(AssignmentNode n, TransferInput<V, S> in) visitCase(CaseNode n, TransferInput<V, S> in) A case produces no value, but it may imply some facts about switch selector expression.visitClassName(ClassNameNode n, TransferInput<V, S> in) Reverse the role of the 'thenStore' and 'elseStore'.Visits a deconstructor pattern node.visitEqualTo(EqualToNode n, TransferInput<V, S> p) visitExpressionStatement(ExpressionStatementNode n, TransferInput<V, S> vsTransferInput) Visits an expression that is used as a statement.visitInstanceOf(InstanceOfNode node, TransferInput<V, S> in) Use the most specific type information available according to the store.visitNode(Node n, TransferInput<V, S> in) The default visitor returns the input information unchanged, or in the case of conditional input information, merged.visitNotEqual(NotEqualNode n, TransferInput<V, S> p) visitReturn(ReturnNode n, TransferInput<V, S> p) visitSwitchExpressionNode(SwitchExpressionNode n, TransferInput<V, S> vsTransferInput) visitThis(ThisNode n, TransferInput<V, S> in) Methods inherited from class org.checkerframework.dataflow.cfg.node.AbstractNodeVisitor
visitArrayCreation, visitArrayType, visitAssertionError, visitBitwiseAnd, visitBitwiseComplement, visitBitwiseOr, visitBitwiseXor, visitBooleanLiteral, visitCharacterLiteral, visitClassDeclaration, visitConditionalAnd, visitConditionalOr, visitDoubleLiteral, visitExplicitThis, visitFloatingDivision, visitFloatingRemainder, visitFloatLiteral, visitGreaterThan, visitGreaterThanOrEqual, visitImplicitThis, visitIntegerDivision, visitIntegerLiteral, visitIntegerRemainder, visitLeftShift, visitLessThan, visitLessThanOrEqual, visitLongLiteral, visitMarker, visitMemberReference, visitMethodAccess, visitNullChk, visitNullLiteral, visitNumericalAddition, visitNumericalMinus, visitNumericalMultiplication, visitNumericalPlus, visitNumericalSubtraction, visitPackageName, visitParameterizedType, visitPrimitiveType, visitShortLiteral, visitSignedRightShift, visitStringConcatenate, visitStringLiteral, visitSuper, visitSynchronized, visitThrow, visitTypeCast, visitUnsignedRightShift, 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, visitBitwiseAnd, visitBitwiseComplement, visitBitwiseOr, visitBitwiseXor, visitBooleanLiteral, visitCharacterLiteral, visitClassDeclaration, visitConditionalAnd, visitConditionalOr, visitDoubleLiteral, visitExplicitThis, visitFloatingDivision, visitFloatingRemainder, visitFloatLiteral, visitGreaterThan, visitGreaterThanOrEqual, visitImplicitThis, visitIntegerDivision, visitIntegerLiteral, visitIntegerRemainder, visitLeftShift, visitLessThan, visitLessThanOrEqual, visitLongLiteral, visitMarker, visitMemberReference, visitMethodAccess, visitNullChk, visitNullLiteral, visitNumericalAddition, visitNumericalMinus, visitNumericalMultiplication, visitNumericalPlus, visitNumericalSubtraction, visitPackageName, visitParameterizedType, visitPrimitiveType, visitShortLiteral, visitSignedRightShift, visitStringConcatenate, visitStringLiteral, visitSuper, visitSynchronized, visitThrow, visitTypeCast, visitUnsignedRightShift
-
Field Details
-
analysis
protected final CFAbstractAnalysis<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, analysisS>, T extends CFAbstractTransfer<V, S, T>> The analysis used by this transfer function. -
sequentialSemantics
protected final boolean sequentialSemanticsShould the analysis use sequential Java semantics (i.e., assume that only one thread is running at all times)?
-
-
Constructor Details
-
CFAbstractTransfer
Create a CFAbstractTransfer.- Parameters:
analysis- the analysis used by this transfer function
-
CFAbstractTransfer
Constructor that allows forcing concurrent semantics to be on for this instance of CFAbstractTransfer.- Parameters:
analysis- the analysis used by this transfer functionforceConcurrentSemantics- whether concurrent semantics should be forced to be on. If false, concurrent semantics are turned off by default, but the user can still turn them on via-AconcurrentSemantics. If true, the user cannot turn off concurrent semantics.
-
-
Method Details
-
usesSequentialSemantics
Returns true if the transfer function uses sequential semantics, false if it uses concurrent semantics. Useful when creating an empty store, since a store makes different decisions depending on whether sequential or concurrent semantics are used.- Returns:
- true if the transfer function uses sequential semantics, false if it uses concurrent semantics
-
finishValue
A hook for subclasses to modify the result of the transfer function. This method is called before returning the abstract valuevalueas the result of the transfer function.If a subclass overrides this method, the subclass should also override
finishValue(CFAbstractValue,CFAbstractStore,CFAbstractStore).- Parameters:
value- a value to possibly modifystore- the store- Returns:
- the possibly-modified value
-
finishValue
A hook for subclasses to modify the result of the transfer function. This method is called before returning the abstract valuevalueas the result of the transfer function.If a subclass overrides this method, the subclass should also override
finishValue(CFAbstractValue,CFAbstractStore).- Parameters:
value- the value to finishthenStore- the "then" storeelseStore- the "else" store- Returns:
- the possibly-modified value
-
getValueFromFactory
Returns the abstract value of a non-leaf treetree, as computed by theAnnotatedTypeFactory.- Returns:
- the abstract value of a non-leaf tree
tree, as computed by theAnnotatedTypeFactory
-
setFixedInitialStore
Set a fixed initial Store.- Parameters:
s- initial store; possible null
-
initialStore
The initial store maps method formal parameters to their currently most refined type.- Specified by:
initialStorein interfaceForwardTransferFunction<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Parameters:
underlyingAST- an abstract syntax treeparameters- a list of local variable nodes representing formal parameters (if any)- Returns:
- the initial store
-
isNotFullyInitializedReceiver
Returns true if the receiver of a method or constructor might not be fully initialized according toanalysis.atypeFactory.isNotFullyInitializedReceiver(methodDeclTree).- Parameters:
methodDeclTree- the declaration of the method or constructor- Returns:
- true if the receiver of a method or constructor might not be fully initialized
- See Also:
-
addInformationFromPreconditions
protected void addInformationFromPreconditions(S initialStore, AnnotatedTypeFactory factory, UnderlyingAST.CFGMethod methodAst, MethodTree methodDeclTree, ExecutableElement methodElement) Add the information from all the preconditions of a method to the initial store in the method body.- Parameters:
initialStore- the initial store for the method bodyfactory- the type factorymethodAst- the AST for a method declarationmethodDeclTree- the declaration of the method; is a field ofmethodAstmethodElement- the element for the method
-
visitNode
The default visitor returns the input information unchanged, or in the case of conditional input information, merged.- Specified by:
visitNodein classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
createTransferResult
@SideEffectFree protected TransferResult<V,S> createTransferResult(@Nullable V value, TransferInput<V, S> in) Creates a TransferResult.This default implementation returns the input information unchanged, or in the case of conditional input information, merged.
- Parameters:
value- the value; possibly nullin- the transfer input- Returns:
- the input information, as a TransferResult
-
recreateTransferResult
@SideEffectFree protected TransferResult<V,S> recreateTransferResult(@Nullable V value, TransferResult<V, S> in) Creates a TransferResult just like the given one, but with the given value.This default implementation returns the input information unchanged, or in the case of conditional input information, merged.
- Parameters:
value- the value; possibly nullin- the TransferResult to copy- Returns:
- the input information
-
visitClassName
- Specified by:
visitClassNamein interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitClassNamein classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitFieldAccess
- Specified by:
visitFieldAccessin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitFieldAccessin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitArrayAccess
- Specified by:
visitArrayAccessin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitArrayAccessin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitLocalVariable
Use the most specific type information available according to the store.- Specified by:
visitLocalVariablein interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitLocalVariablein classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitThis
- Overrides:
visitThisin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitTernaryExpression
- Specified by:
visitTernaryExpressionin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitTernaryExpressionin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitSwitchExpressionNode
public TransferResult<V,S> visitSwitchExpressionNode(SwitchExpressionNode n, TransferInput<V, S> vsTransferInput) - Specified by:
visitSwitchExpressionNodein interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitSwitchExpressionNodein classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitConditionalNot
Reverse the role of the 'thenStore' and 'elseStore'.- Specified by:
visitConditionalNotin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitConditionalNotin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitEqualTo
- Specified by:
visitEqualToin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitEqualToin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitNotEqual
- Specified by:
visitNotEqualin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitNotEqualin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
strengthenAnnotationOfEqualTo
protected TransferResult<V,S> strengthenAnnotationOfEqualTo(TransferResult<V, S> res, Node firstNode, Node secondNode, V firstValue, V secondValue, boolean notEqualTo) Refine 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,
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.- Parameters:
res- 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
-
splitAssignments
Takes a node, and either returns the node itself again (as a singleton list), or if the node is an assignment node, returns the lhs and rhs (where splitAssignments is applied recursively to the rhs -- that is, it is possible that the rhs does not appear in the result, but rather its lhs and rhs do).- Parameters:
node- possibly an assignment node- Returns:
- a list containing all the right- and left-hand sides in the given assignment node; it contains just the node itself if it is not an assignment)
-
visitAssignment
- Specified by:
visitAssignmentin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitAssignmentin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitReturn
- Specified by:
visitReturnin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitReturnin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitLambdaResultExpression
public TransferResult<V,S> visitLambdaResultExpression(LambdaResultExpressionNode n, TransferInput<V, S> in) - Specified by:
visitLambdaResultExpressionin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitLambdaResultExpressionin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
processCommonAssignment
protected void processCommonAssignment(TransferInput<V, S> in, Node lhs, Node rhs, S store, V rhsValue) Determine abstract value of right-hand side and update the store accordingly.- Parameters:
in- the store(s) before the assignmentlhs- the left-hand side of the assignmentrhs- the right-hand side of the assignmentstore- the regular input store (fromin)rhsValue- the value of the right-hand side of the assignment
-
visitObjectCreation
- Specified by:
visitObjectCreationin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitObjectCreationin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitMethodInvocation
- Specified by:
visitMethodInvocationin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitMethodInvocationin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitDeconstructorPattern
public TransferResult<V,S> visitDeconstructorPattern(DeconstructorPatternNode n, TransferInput<V, S> in) Description copied from interface:NodeVisitorVisits a deconstructor pattern node.- Specified by:
visitDeconstructorPatternin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitDeconstructorPatternin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>> - Parameters:
n- theDeconstructorPatternNodeto be visitedin- the argument for the operation implemented by this visitor- Returns:
- the return value of the operation implemented by this visitor
-
visitInstanceOf
- Specified by:
visitInstanceOfin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitInstanceOfin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
processPostconditions
protected void processPostconditions(Node invocationNode, S store, ExecutableElement executableElement, ExpressionTree invocationTree) Add information from the postconditions of a method to the store after an invocation.- Parameters:
invocationNode- a method call or an object creationstore- a store; is side-effected by this methodexecutableElement- the method or constructor being calledinvocationTree- the tree for the method call or for the object creation
-
processConditionalPostconditions
protected void processConditionalPostconditions(MethodInvocationNode invocationNode, ExecutableElement methodElement, ExpressionTree invocationTree, S thenStore, S elseStore) Add information from the conditional postconditions of a method to the stores after an invocation.- Parameters:
invocationNode- a method callmethodElement- the method being calledinvocationTree- the tree for the method callthenStore- the "then" store; is side-effected by this methodelseStore- the "else" store; is side-effected by this method
-
visitCase
A case produces no value, but it may imply some facts about switch selector expression.- Specified by:
visitCasein interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitCasein classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
moreSpecificValue
Returns the abstract value of(value1, value2)that is more specific. If the two are incomparable, thenvalue1is returned.- Parameters:
value1- an abstract valuevalue2- another abstract value- Returns:
- the more specific value of the two parameters, or, if they are incomparable,
value1
-
visitVariableDeclaration
public TransferResult<V,S> visitVariableDeclaration(VariableDeclarationNode n, TransferInput<V, S> p) - Specified by:
visitVariableDeclarationin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitVariableDeclarationin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitWideningConversion
- Specified by:
visitWideningConversionin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitWideningConversionin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
getNarrowedValue
Returns an abstract value with the giventypeand the annotations fromannotatedValue, adapted for narrowing. This is only called at a narrowing conversion.- Parameters:
type- the type to narrow toannotatedValue- the type to narrow from- Returns:
- an abstract value with the given
typeand the annotations fromannotatedValue; returns null ifannotatedValueis null
-
getWidenedValue
Returns an abstract value with the giventypeand the annotations fromannotatedValue, adapted for widening. This is only called at a widening conversion.- Parameters:
type- the type to widen toannotatedValue- the type to widen from- Returns:
- an abstract value with the given
typeand the annotations fromannotatedValue; returns null ifannotatedValueis null
-
visitNarrowingConversion
public TransferResult<V,S> visitNarrowingConversion(NarrowingConversionNode n, TransferInput<V, S> p) - Specified by:
visitNarrowingConversionin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitNarrowingConversionin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitStringConversion
- Specified by:
visitStringConversionin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitStringConversionin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>>
-
visitExpressionStatement
public TransferResult<V,S> visitExpressionStatement(ExpressionStatementNode n, TransferInput<V, S> vsTransferInput) Description copied from interface:NodeVisitorVisits an expression that is used as a statement. This node is a marker after the expression node(s).- Specified by:
visitExpressionStatementin interfaceNodeVisitor<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>> - Overrides:
visitExpressionStatementin classAbstractNodeVisitor<TransferResult<V extends CFAbstractValue<V>,S extends CFAbstractStore<V, S>>, TransferInput<V extends CFAbstractValue<V>, S extends CFAbstractStore<V, S>>> - Parameters:
n- theExpressionStatementNodeto be visitedvsTransferInput- the argument for the operation implemented by this visitor- Returns:
- the return value of the operation implemented by this visitor
-
insertIntoStores
protected static void insertIntoStores(TransferResult<CFValue, CFStore> result, JavaExpression target, AnnotationMirror newAnno) Inserts newAnno as the value into all stores (conditional or not) in the result for node. This is a utility method for subclasses.- Parameters:
result- the TransferResult holding the stores to modifytarget- the receiver whose value should be modifiednewAnno- the new value
-