Search in sources :

Example 1 with ArraySparseSet

use of soot.toolkits.scalar.ArraySparseSet in project soot by Sable.

the class NullTransformer method internalTransform.

protected void internalTransform(Body b, String phaseName, java.util.Map options) {
    NullnessAnalysis na = new NullnessAnalysis(new BriefUnitGraph(b));
    java.util.Iterator uIt = b.getUnits().iterator();
    while (uIt.hasNext()) {
        Unit u = (Unit) uIt.next();
        StringBuffer n = new StringBuffer();
        u.addTag(new StringTag("IN: " + na.getFlowBefore(u).toString()));
        if (u.fallsThrough()) {
            ArraySparseSet s = (ArraySparseSet) na.getFallFlowAfter(u);
            u.addTag(new StringTag("FALL: " + s.toString()));
        }
        if (u.branches()) {
            ArraySparseSet t = (ArraySparseSet) na.getBranchFlowAfter(u).get(0);
            u.addTag(new StringTag("BRANCH: " + t.toString()));
        }
    }
}
Also used : StringTag(soot.tagkit.StringTag) ArraySparseSet(soot.toolkits.scalar.ArraySparseSet) BriefUnitGraph(soot.toolkits.graph.BriefUnitGraph) Unit(soot.Unit)

Aggregations

Unit (soot.Unit)1 StringTag (soot.tagkit.StringTag)1 BriefUnitGraph (soot.toolkits.graph.BriefUnitGraph)1 ArraySparseSet (soot.toolkits.scalar.ArraySparseSet)1