Search in sources :

Example 1 with PlaceholderInst

use of soot.baf.PlaceholderInst in project soot by Sable.

the class JTableSwitchStmt method convertToBaf.

public void convertToBaf(JimpleToBafContext context, List<Unit> out) {
    List<PlaceholderInst> targetPlaceholders = new ArrayList<PlaceholderInst>();
    ((ConvertToBaf) getKey()).convertToBaf(context, out);
    for (Unit target : getTargets()) {
        targetPlaceholders.add(Baf.v().newPlaceholderInst(target));
    }
    Unit u = Baf.v().newTableSwitchInst(Baf.v().newPlaceholderInst(getDefaultTarget()), lowIndex, highIndex, targetPlaceholders);
    u.addAllTagsOf(this);
    out.add(u);
}
Also used : PlaceholderInst(soot.baf.PlaceholderInst) ArrayList(java.util.ArrayList) ConvertToBaf(soot.jimple.ConvertToBaf) Unit(soot.Unit)

Example 2 with PlaceholderInst

use of soot.baf.PlaceholderInst in project soot by Sable.

the class JLookupSwitchStmt method convertToBaf.

public void convertToBaf(JimpleToBafContext context, List<Unit> out) {
    List<PlaceholderInst> targetPlaceholders = new ArrayList<PlaceholderInst>();
    ((ConvertToBaf) getKey()).convertToBaf(context, out);
    for (Unit target : getTargets()) {
        targetPlaceholders.add(Baf.v().newPlaceholderInst(target));
    }
    Unit u = Baf.v().newLookupSwitchInst(Baf.v().newPlaceholderInst(getDefaultTarget()), getLookupValues(), targetPlaceholders);
    u.addAllTagsOf(this);
    out.add(u);
}
Also used : PlaceholderInst(soot.baf.PlaceholderInst) ArrayList(java.util.ArrayList) ConvertToBaf(soot.jimple.ConvertToBaf) Unit(soot.Unit)

Aggregations

ArrayList (java.util.ArrayList)2 Unit (soot.Unit)2 PlaceholderInst (soot.baf.PlaceholderInst)2 ConvertToBaf (soot.jimple.ConvertToBaf)2