All Downloads are FREE. Search and download functionalities are using the official Maven repository.

soot.jimple.infoflow.solver.gcSolver.AheadOfTimeReferenceProvider Maven / Gradle / Ivy

The newest version!
package soot.jimple.infoflow.solver.gcSolver;

import java.util.Set;

import soot.Scene;
import soot.SootClass;
import soot.SootMethod;
import soot.jimple.toolkits.ide.icfg.BiDiInterproceduralCFG;
import soot.util.HashMultiMap;
import soot.util.MultiMap;

/**
 * Implementation of a reference provider that computes its dependencies ahead
 * of time, and over-approximates the possible references by considering all
 * transitively callees of a given method as possible locations for new analysis
 * tasks, regardless of context and taint state.
 * 
 * @author Steven Arzt
 */
public class AheadOfTimeReferenceProvider extends AbstractReferenceProvider {

	private final MultiMap methodToCallees = new HashMultiMap<>();

	public AheadOfTimeReferenceProvider(BiDiInterproceduralCFG icfg) {
		super(icfg);

		// Initialize the caller/callee relationships
		for (SootClass sc : Scene.v().getClasses()) {
			for (SootMethod sm : sc.getMethods())
				methodToCallees.putAll(sm, getTransitiveCallees(sm));
		}
	}

	@Override
	public Set getAbstractionReferences(SootMethod method) {
		return methodToCallees.get(method);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy