soot.toolkits.scalar.ForwardBranchedFlowAnalysis Maven / Gradle / Ivy
package soot.toolkits.scalar;
/*-
* #%L
* Soot - a J*va Optimization Framework
* %%
* Copyright (C) 1997 - 2000 Raja Vallee-Rai
* %%
* This program 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 program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* .
* #L%
*/
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import soot.Timers;
import soot.Trap;
import soot.Unit;
import soot.UnitBox;
import soot.options.Options;
import soot.toolkits.graph.PseudoTopologicalOrderer;
import soot.toolkits.graph.UnitGraph;
import soot.toolkits.graph.interaction.FlowInfo;
import soot.toolkits.graph.interaction.InteractionHandler;
import soot.util.Chain;
/**
* Abstract class providing an engine for branched forward flow analysis. WARNING: This does not handle exceptional flow as
* branches!
*/
public abstract class ForwardBranchedFlowAnalysis extends BranchedFlowAnalysis {
private static final Logger logger = LoggerFactory.getLogger(ForwardBranchedFlowAnalysis.class);
public ForwardBranchedFlowAnalysis(UnitGraph graph) {
super(graph);
}
protected boolean isForward() {
return true;
}
// Accumulate the previous afterFlow sets.
private void accumulateAfterFlowSets(Unit s, A[] flowRepositories, List