Package soot.jimple

Examples of soot.jimple.NopStmt


 
  /** Generates code for an if statement. */
  @Override
  public Void visitIfStmt(IfStmt nd) {
    Value cond = ExprCodeGenerator.generate(nd.getExpr(), fcg);
    NopStmt join = j.newNopStmt();
    units.add(j.newIfStmt(j.newEqExpr(cond, IntConstant.v(0)), join));
    nd.getThen().accept(this);
    if(nd.hasElse()) {
      NopStmt els = join;
      join = j.newNopStmt();
      units.add(j.newGotoStmt(join));
      units.add(els);
      nd.getElse().accept(this);
    }
View Full Code Here


    if c == 0 goto label1
    // code for body
    goto label0
    label1:
     */
    NopStmt label0 = j.newNopStmt();
    this.units.add(label0);
   
    Value cond = ExprCodeGenerator.generate(nd.getExpr(), this.fcg);
    NopStmt label1 = j.newNopStmt();
    this.units.add(
        j.newIfStmt(
            j.newEqExpr(cond, IntConstant.v(0)),
            label1
            )
View Full Code Here

      }
    });
    // compute a result of 0 or 1 depending on the truth value of the expression
    Local resvar = fcg.mkTemp(SootTypeUtil.getSootType(nd.type()));
    units.add(Jimple.v().newAssignStmt(resvar, IntConstant.v(1)));
    NopStmt join = Jimple.v().newNopStmt();
    units.add(Jimple.v().newIfStmt(res, join));
    units.add(Jimple.v().newAssignStmt(resvar, IntConstant.v(0)));
    units.add(join);
    return resvar;
  }
View Full Code Here

TOP

Related Classes of soot.jimple.NopStmt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.