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

soot.jimple.infoflow.util.SootUtils Maven / Gradle / Ivy

There is a newer version: 2.9.0
Show newest version
package soot.jimple.infoflow.util;

import java.util.ArrayList;
import java.util.List;

import soot.Unit;
import soot.Value;
import soot.ValueBox;
import soot.jimple.InvokeExpr;

/**
 * Class containing various utility methods for dealing with Soot
 * 
 * @author Steven Arzt
 *
 */
public class SootUtils {

	public static List getUseAndDefValues(Unit u) {
		List valueList = new ArrayList<>();
		for (ValueBox vb : u.getUseAndDefBoxes()) {
			Value val = vb.getValue();
			if (val instanceof InvokeExpr) {
				InvokeExpr iexpr = (InvokeExpr) val;
				for (ValueBox invBox : iexpr.getUseBoxes())
					valueList.add(invBox.getValue());
			} else
				valueList.add(val);
		}
		return valueList;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy