Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /* Soot - a J*va Optimization Framework
  * Copyright (C) 1997-2000 Patrick Lam
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * Lesser General Public License for more details.
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 * Modified by the Sable Research Group and others 1997-2000.
 * See the 'credits' file distributed with Soot for the complete list of
 * contributors.  (Soot is distributed at
    2000, March 20 - Updated code provided by
                                    Patrick Lam <>
                     -- Janus (Richard Godard)
package soot.toolkits.scalar;
import soot.*;
import java.util.*;

Abstract class providing functionality for branched flow analysis. A branched flow analysis is one which can propagate different information to the successors of a node. This is useful for propagating information past a statement like if(x > 0): one successor has x > 0 while the other successor has x &le; 0.
public abstract class BranchedFlowAnalysis<N extends Unit,A> extends AbstractFlowAnalysis<N,A>
Maps graph nodes to OUT sets.
    protected Map<UnitArrayList<A>> unitToAfterFallFlow;
    protected Map<UnitArrayList<A>> unitToAfterBranchFlow;
    public BranchedFlowAnalysis(DirectedGraph<N> graph)
         = new HashMap<UnitArrayList<A>>(graph.size() * 2 + 1, 0.7f);
         = new HashMap<UnitArrayList<A>>(graph.size() * 2 + 1, 0.7f);

Given the merge of the in sets, compute the fallOut and branchOuts set for s.
    protected abstract void flowThrough(A inUnit s
                                        List<A> fallOutList<A> branchOuts);
    public A getFallFlowAfter(Unit s)
        List<A> fl = .get(s);
        if (fl.isEmpty())
            return newInitialFlow();
            return fl.get(0);
    public List<A> getBranchFlowAfter(Unit s)
        return (.get(s));
    public A getFlowBefore(Unit s)
        return .get(s);
// end class BranchedFlowAnalysis
New to GrepCode? Check out our FAQ X