Search in sources :

Example 41 with CFStore

use of org.checkerframework.framework.flow.CFStore in project checker-framework by typetools.

the class ValueTransfer method visitLessThanOrEqual.

@Override
public TransferResult<CFValue, CFStore> visitLessThanOrEqual(LessThanOrEqualNode n, TransferInput<CFValue, CFStore> p) {
    TransferResult<CFValue, CFStore> transferResult = super.visitLessThanOrEqual(n, p);
    CFStore thenStore = transferResult.getThenStore();
    CFStore elseStore = transferResult.getElseStore();
    List<Boolean> resultValues = calculateBinaryComparison(n.getLeftOperand(), p.getValueOfSubNode(n.getLeftOperand()), n.getRightOperand(), p.getValueOfSubNode(n.getRightOperand()), ComparisonOperators.LESS_THAN_EQ, thenStore, elseStore);
    TypeMirror underlyingType = transferResult.getResultValue().getUnderlyingType();
    return createNewResultBoolean(thenStore, elseStore, resultValues, underlyingType);
}
Also used : CFValue(org.checkerframework.framework.flow.CFValue) CFStore(org.checkerframework.framework.flow.CFStore) TypeMirror(javax.lang.model.type.TypeMirror)

Example 42 with CFStore

use of org.checkerframework.framework.flow.CFStore in project checker-framework by typetools.

the class ValueTransfer method visitNumericalMultiplication.

@Override
public TransferResult<CFValue, CFStore> visitNumericalMultiplication(NumericalMultiplicationNode n, TransferInput<CFValue, CFStore> p) {
    TransferResult<CFValue, CFStore> transferResult = super.visitNumericalMultiplication(n, p);
    AnnotationMirror resultAnno = calculateNumericalBinaryOp(n.getLeftOperand(), n.getRightOperand(), NumericalBinaryOps.MULTIPLICATION, p);
    return createNewResult(transferResult, resultAnno);
}
Also used : CFValue(org.checkerframework.framework.flow.CFValue) AnnotationMirror(javax.lang.model.element.AnnotationMirror) CFStore(org.checkerframework.framework.flow.CFStore)

Example 43 with CFStore

use of org.checkerframework.framework.flow.CFStore in project checker-framework by typetools.

the class ValueTransfer method visitIntegerDivision.

@Override
public TransferResult<CFValue, CFStore> visitIntegerDivision(IntegerDivisionNode n, TransferInput<CFValue, CFStore> p) {
    TransferResult<CFValue, CFStore> transferResult = super.visitIntegerDivision(n, p);
    AnnotationMirror resultAnno = calculateNumericalBinaryOp(n.getLeftOperand(), n.getRightOperand(), NumericalBinaryOps.DIVISION, p);
    return createNewResult(transferResult, resultAnno);
}
Also used : CFValue(org.checkerframework.framework.flow.CFValue) AnnotationMirror(javax.lang.model.element.AnnotationMirror) CFStore(org.checkerframework.framework.flow.CFStore)

Example 44 with CFStore

use of org.checkerframework.framework.flow.CFStore in project checker-framework by typetools.

the class ValueTransfer method visitNumericalPlus.

@Override
public TransferResult<CFValue, CFStore> visitNumericalPlus(NumericalPlusNode n, TransferInput<CFValue, CFStore> p) {
    TransferResult<CFValue, CFStore> transferResult = super.visitNumericalPlus(n, p);
    AnnotationMirror resultAnno = calculateNumericalUnaryOp(n.getOperand(), NumericalUnaryOps.PLUS, p);
    return createNewResult(transferResult, resultAnno);
}
Also used : CFValue(org.checkerframework.framework.flow.CFValue) AnnotationMirror(javax.lang.model.element.AnnotationMirror) CFStore(org.checkerframework.framework.flow.CFStore)

Example 45 with CFStore

use of org.checkerframework.framework.flow.CFStore in project checker-framework by typetools.

the class ValueTransfer method visitNumericalAddition.

@Override
public TransferResult<CFValue, CFStore> visitNumericalAddition(NumericalAdditionNode n, TransferInput<CFValue, CFStore> p) {
    TransferResult<CFValue, CFStore> transferResult = super.visitNumericalAddition(n, p);
    AnnotationMirror resultAnno = calculateNumericalBinaryOp(n.getLeftOperand(), n.getRightOperand(), NumericalBinaryOps.ADDITION, p);
    return createNewResult(transferResult, resultAnno);
}
Also used : CFValue(org.checkerframework.framework.flow.CFValue) AnnotationMirror(javax.lang.model.element.AnnotationMirror) CFStore(org.checkerframework.framework.flow.CFStore)

Aggregations

CFStore (org.checkerframework.framework.flow.CFStore)45 CFValue (org.checkerframework.framework.flow.CFValue)41 AnnotationMirror (javax.lang.model.element.AnnotationMirror)31 MethodInvocationNode (org.checkerframework.dataflow.cfg.node.MethodInvocationNode)8 Node (org.checkerframework.dataflow.cfg.node.Node)8 Receiver (org.checkerframework.dataflow.analysis.FlowExpressions.Receiver)7 TypeMirror (javax.lang.model.type.TypeMirror)5 ConditionalTransferResult (org.checkerframework.dataflow.analysis.ConditionalTransferResult)5 AssignmentNode (org.checkerframework.dataflow.cfg.node.AssignmentNode)5 ArrayCreationNode (org.checkerframework.dataflow.cfg.node.ArrayCreationNode)4 FieldAccessNode (org.checkerframework.dataflow.cfg.node.FieldAccessNode)4 Tree (com.sun.source.tree.Tree)3 ExecutableElement (javax.lang.model.element.ExecutableElement)3 RegularTransferResult (org.checkerframework.dataflow.analysis.RegularTransferResult)3 ClassNameNode (org.checkerframework.dataflow.cfg.node.ClassNameNode)3 GreaterThanNode (org.checkerframework.dataflow.cfg.node.GreaterThanNode)3 GreaterThanOrEqualNode (org.checkerframework.dataflow.cfg.node.GreaterThanOrEqualNode)3 IntegerLiteralNode (org.checkerframework.dataflow.cfg.node.IntegerLiteralNode)3 LessThanNode (org.checkerframework.dataflow.cfg.node.LessThanNode)3 LessThanOrEqualNode (org.checkerframework.dataflow.cfg.node.LessThanOrEqualNode)3