Package edu.umd.cs.findbugs.ba

Examples of edu.umd.cs.findbugs.ba.Edge


            // Figure out which control edge is made infeasible by the redundant
            // comparison
            boolean wantSame = (lastHandle.getInstruction().getOpcode() == Constants.IF_ACMPEQ);
            int infeasibleEdgeType = (wantSame == definitelySame) ? EdgeTypes.FALL_THROUGH_EDGE : EdgeTypes.IFCMP_EDGE;
            Edge infeasibleEdge = invDataflow.getCFG().getOutgoingEdgeWithType(basicBlock, infeasibleEdgeType);
            redundantBranch.setInfeasibleEdge(infeasibleEdge);

            if (DEBUG) {
                System.out.println("Adding redundant branch: " + redundantBranch);
            }
View Full Code Here


        // Determine which control edge is made infeasible by the redundant
        // comparison
        boolean wantNull = (opcode == Constants.IFNULL);
        int infeasibleEdgeType = (wantNull == top.isDefinitelyNull()) ? EdgeTypes.FALL_THROUGH_EDGE : EdgeTypes.IFCMP_EDGE;
        Edge infeasibleEdge = invDataflow.getCFG().getOutgoingEdgeWithType(basicBlock, infeasibleEdgeType);
        redundantBranch.setInfeasibleEdge(infeasibleEdge);

        if (DEBUG) {
            System.out.println("Adding redundant branch: " + redundantBranch);
        }
View Full Code Here

                    loc, vnaDataflow.getFactAtLocation(loc));
            checkForEqualityTest(xmethod, cfg, typeQualifierValue, forwardsFact, loc, vnaDataflow.getFactAtLocation(loc));
        }

        for (Iterator<Edge> i = cfg.edgeIterator(); i.hasNext();) {
            Edge edge = i.next();


            // NOTE: when checking forwards and backwards values on an edge,
            // we don't want to apply BOTH edge transfer functions,
            // since the purpose of the edge transfer function is to
            // propagate information across phi nodes (effectively
            // copying information about one value to another).
            // Due to pruning of backwards values when a conflict is detected,
            // we need to check backwards values as "early" as possible,
            // meaning that we want to check at the edge target
            // (before the backwards edge transfer function has pruned
            // the backwards value.)
            TypeQualifierValueSet forwardFact = forwardDataflow.getFactOnEdge(edge);
            TypeQualifierValueSet backwardFact = backwardDataflow.getResultFact(edge.getTarget());

            // The edge target location is where we can check
            // for conflicting flow values.
            Location edgeTargetLocation = getEdgeTargetLocation(cfg, edge);
            ValueNumberFrame vnaFrame = (edgeTargetLocation != null) ? vnaDataflow.getFactAtLocation(edgeTargetLocation) : null;

            // What location do we want to report to the user
            // as where the conflict occurs?
            // The edge source location is generally better,
            // but edge target location is ok as a fallback.
            Location locationToReport;
            if (edge.getSource().getLastInstruction() != null) {
                locationToReport = getEdgeSourceLocation(cfg, edge);
            } else {
                locationToReport = edgeTargetLocation;
            }
View Full Code Here

        if (targetBlock.isExceptionThrower()) {
            BasicBlock fallThroughSuccessor = cfg.getSuccessorWithEdgeType(targetBlock, EdgeTypes.FALL_THROUGH_EDGE);
            if (fallThroughSuccessor == null) {
                // Fall through edge might have been pruned
                for (Iterator<Edge> i = cfg.removedEdgeIterator(); i.hasNext();) {
                    Edge removedEdge = i.next();
                    if (removedEdge.getSource() == targetBlock && removedEdge.getType() == EdgeTypes.FALL_THROUGH_EDGE) {
                        fallThroughSuccessor = removedEdge.getTarget();
                        break;
                    }
                }
            }
View Full Code Here

     */
    public void execute(InstructionScannerGenerator generator) {
        // Pump the instructions in the path through the generator and all
        // generated scanners
        while (edgeIter.hasNext()) {
            Edge edge = edgeIter.next();
            BasicBlock source = edge.getSource();
            if (DEBUG) {
                System.out.println("ISD: scanning instructions in block " + source.getLabel());
            }

            // Traverse all instructions in the source block
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.ba.Edge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.