Package edu.umd.cs.findbugs.ba

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


    @Override
    public void transferInstruction(InstructionHandle handle, BasicBlock basicBlock, ValueNumberFrame fact)
            throws DataflowAnalysisException {

        Location location = new Location(handle, basicBlock);

        ValueNumberFrame atLocation = getFactAtLocation(location);
        copy(fact, atLocation);

        visitor.setFrameAndLocation(fact, new Location(handle, basicBlock));
        visitor.setHandle(handle);
        visitor.analyzeInstruction(handle.getInstruction());

        ValueNumberFrame afterLocation = getFactAfterLocation(location);
        copy(fact, afterLocation);
View Full Code Here


        if (!fact.isValid()) {
            return;
        }

        if (PRUNE_CONFLICTING_VALUES && forwardTypeQualifierDataflow != null) {
            Location location = new Location(handle, basicBlock);
            pruneConflictingValues(fact, forwardTypeQualifierDataflow.getFactAfterLocation(location));
        }

        super.transferInstruction(handle, basicBlock, fact);
    }
View Full Code Here

        if (!xmethod.getSignature().endsWith(")V")) {
            returnValueAnnotation = TypeQualifierApplications.getEffectiveTypeQualifierAnnotation(xmethod, typeQualifierValue);
        }

        for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
            Location location = i.next();

            Instruction ins = location.getHandle().getInstruction();

            if (ins instanceof ReturnInstruction && !(ins instanceof RETURN)) {
                // Return instruction which returns a value
                modelReturn(returnValueAnnotation, location);
            } else {
                short opcode = ins.getOpcode();

                if (opcode == Constants.PUTFIELD || opcode == Constants.PUTSTATIC) {
                    modelFieldStore(location);
                } else if (location.getHandle().getInstruction() instanceof InvokeInstruction) {
                    modelArguments(location);
                }
            }
        }
    }
View Full Code Here

        Instruction instruction = handle.getInstruction();
        if (fact.isTop()) {
            return;
        }
        Location location = new Location(handle, basicBlock);

        // If this is a call to an assertion method,
        // change the dataflow value to be TOP.
        // We don't want to report future derefs that would
        // be guaranteed only if the assertion methods
View Full Code Here

            FlowValue effectiveFlowValue = null;

            CFG cfg = dataflow.getCFG();
            Iterator<Location> i = cfg.locationIterator();
            while (i.hasNext()) {
                Location loc = i.next();
                InstructionHandle handle = loc.getHandle();
                Instruction ins = handle.getInstruction();
                if (ins instanceof ReturnInstruction && !(ins instanceof RETURN)) {
                    ValueNumberFrame vnaFrame = vnaDataflow.getFactAtLocation(loc);
                    ValueNumber topVN = vnaFrame.getTopValue();
View Full Code Here

        registerInstructionSources();
    }

    private void registerInstructionSources() throws DataflowAnalysisException {
        for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
            Location location = i.next();
            Instruction instruction = location.getHandle().getInstruction();
            short opcode = instruction.getOpcode();

            int produces = instruction.produceStack(cpg);
            if (instruction instanceof InvokeInstruction) {
                // Model return value
View Full Code Here

            addEffectiveRelevantQualifiers(result, xmethod);

            IAnalysisCache analysisCache = Global.getAnalysisCache();
            ConstantPoolGen cpg = analysisCache.getClassAnalysis(ConstantPoolGen.class, methodDescriptor.getClassDescriptor());
            for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
                Location location = i.next();
                Instruction ins = location.getHandle().getInstruction();
                if (ins instanceof InvokeInstruction) {
                    XMethod called = XFactory.createXMethod((InvokeInstruction) ins, cpg);
                    addEffectiveRelevantQualifiers(result, called);
                }
View Full Code Here

        Map<ValueNumber, NullValueUnconditionalDeref> nullValueGuaranteedDerefMap = new HashMap<ValueNumber, NullValueUnconditionalDeref>();

        // Check every location
        CFG cfg = classContext.getCFG(method);
        for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
            Location location = i.next();

            if (DEBUG_DEREFS) {
                System.out.println("At location " + location);
            }
View Full Code Here

            BasicBlock source = edge.getSource();
            ValueNumberFrame vnaFact = vnaDataflow.getResultFact(source);
            IsNullValueFrame invFact = invDataflow.getFactAtMidEdge(edge);

            Location location = null;
            if (edge.isExceptionEdge()) {
                BasicBlock b = cfg.getSuccessorWithEdgeType(source, EdgeTypes.FALL_THROUGH_EDGE);
                if (b != null) {
                    location = new Location(source.getExceptionThrower(), b);
                }
            } else {
                location = Location.getLastLocation(source);
            }

            if (location != null) {
                Instruction in = location.getHandle().getInstruction();
                if (assertionMethods.isAssertionInstruction(in, classContext.getConstantPoolGen())) {
                    if (DEBUG_DEREFS) {
                        System.out.println("Skipping because it is an assertion method ");
                    }
                    continue;
View Full Code Here

            strictlyDominated.or(allDominatedBy);
        }
        LinkedList<Location> locations2 = new LinkedList<Location>(locations);

        for (Iterator<Location> i = locations.iterator(); i.hasNext();) {
            Location loc = i.next();
            if (strictlyDominated.get(loc.getBasicBlock().getLabel())) {
                i.remove();
                continue;
            }
            for (Location loc2 : locations2) {
                if (loc.getBasicBlock().equals(loc2.getBasicBlock())
                        && loc.getHandle().getPosition() > loc2.getHandle().getPosition()) {
                    i.remove();
                    break;
                }
            }
        }
View Full Code Here

TOP

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

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.