Java 类soot.jimple.NegExpr 实例源码

项目:JAADAS    文件:ExprVisitor.java   
@Override
public void caseNegExpr(NegExpr ne) {
    Value source = ne.getOp();
    constantV.setOrigStmt(origStmt);
    Register sourceReg = regAlloc.asImmediate(source, constantV);
    Opcode opc;
    Type type = source.getType();
    if (type instanceof IntegerType) {
        opc = Opcode.NEG_INT;
    } else if (type instanceof FloatType) {
        opc = Opcode.NEG_FLOAT;
    } else if (type instanceof DoubleType) {
        opc = Opcode.NEG_DOUBLE;
    } else if (type instanceof LongType) {
        opc = Opcode.NEG_LONG;
    } else {
        throw new RuntimeException("unsupported value type for neg-* opcode: " + type);
    }
       stmtV.addInsn(new Insn12x(opc, destinationReg, sourceReg), origStmt);
}
项目:JAADAS    文件:ValueTemplatePrinter.java   
public void caseNegExpr(NegExpr v) {
    String oldName = varName;

    Value op = v.getOp();
    suggestVariableName("op");
    String opName = varName;
    op.apply(this);

    p.println("Value "+oldName+" = Jimple.v().newNegExpr("+opName+");");
    varName = oldName;
}
项目:JAADAS    文件:DavaBody.java   
private void javafy_unop_expr(ValueBox vb) {
    UnopExpr uoe = (UnopExpr) vb.getValue();

    javafy(uoe.getOpBox());

    if (uoe instanceof LengthExpr)
        vb.setValue(new DLengthExpr(((LengthExpr) uoe).getOp()));
    else if (uoe instanceof NegExpr)
        vb.setValue(new DNegExpr(((NegExpr) uoe).getOp()));
}
项目:bixie    文件:SootBodyTransformer.java   
private Value normalizeNegations(Value v) {
    if (v instanceof NegExpr) {
        return ((NegExpr)v).getOp();
    } else if (v instanceof BinopExpr) {
        BinopExpr bo = (BinopExpr)v;
        if (bo instanceof NeExpr) {
            return new JEqExpr(bo.getOp1(), bo.getOp2());
        }
    }
    return v;
}
项目:bixie    文件:SootValueSwitch.java   
@Override
public void caseNegExpr(NegExpr arg0) {
    // this is arithmetic negative!
    // logic neg is already translated by soot
    this.isLeftHandSide = false;
    arg0.getOp().apply(this);
    Expression e = this.expressionStack.pop();
    this.expressionStack.push(this.pf.mkUnaryExpression(e.getType(),
            UnaryOperator.ARITHNEGATIVE, e));
}
项目:petablox    文件:RelNegExpr.java   
@Override
public void visit(Value e) {
    if (e instanceof NegExpr) {
        NegExpr ne = (NegExpr) e;
        add(e, ne.getOp());
    }
}
项目:jar2bpl    文件:SootBodyTransformer.java   
private Value normalizeNegations(Value v) {
    if (v instanceof NegExpr) {
        return ((NegExpr)v).getOp();
    } else if (v instanceof BinopExpr) {
        BinopExpr bo = (BinopExpr)v;
        if (bo instanceof NeExpr) {
            return new JEqExpr(bo.getOp1(), bo.getOp2());
        }
    }
    return v;
}
项目:jar2bpl    文件:SootValueSwitch.java   
@Override
public void caseNegExpr(NegExpr arg0) {
    // this is arithmetic negative!
    // logic neg is already translated by soot
    this.isLeftHandSide = false;
    arg0.getOp().apply(this);
    Expression e = this.expressionStack.pop();
    this.expressionStack.push(this.pf.mkUnaryExpression(e.getType(),
            UnaryOperator.ARITHNEGATIVE, e));
}
项目:jgs    文件:AnnotationValueSwitch.java   
@Override
public void caseNegExpr(NegExpr v) {
    rightElement = RightElement.NOT;
    if (actualContext == StmtContext.ASSIGNRIGHT) {
        throw new NotSupportedStmtException("NegExpr");
    }
}
项目:FuzzDroid    文件:JimpleExprVisitorImpl.java   
@Override
public void caseNegExpr(NegExpr v) {
    throw new RuntimeException("todo");

}
项目:JAADAS    文件:UnitThrowAnalysis.java   
public void caseNegExpr(NegExpr expr) {
    result = result.add(mightThrow(expr.getOp()));
}
项目:jgs    文件:SecurityConstraintValueWriteSwitch.java   
@Override
public void caseNegExpr(NegExpr v) {
    throwInvalidWriteException(v);
}
项目:jgs    文件:SecurityConstraintValueReadSwitch.java   
@Override
public void caseNegExpr(NegExpr v) {
    handleUnaryExpr(v.getOp());
}
项目:jgs    文件:SecurityLevelValueWriteSwitch.java   
/**
 * The method should update the <em>security level</em> of an expression
 * with type {@link NegExpr}, but it is not possible to update the level of
 * such an expression.
 * 
 * @param v
 *            The expression for which the <em>security level</em> should be
 *            updated.
 * @see soot.jimple.ExprSwitch#caseNegExpr(soot.jimple.NegExpr)
 * @throws InvalidSwitchException
 *             Always, because the update is not possible.
 */
@Override
public void caseNegExpr(NegExpr v) {
    throw new SwitchException(getMsg("exception.analysis.switch.update_error",
                                     this.getClass().getSimpleName(),
                                     v.getClass().getSimpleName(),
                                     v.toString(),
                                     getSourceLine()));
}
项目:jgs    文件:AnnotationValueSwitch.java   
/**
 * DOC
 * 
 * @see soot.jimple.ExprSwitch#caseNegExpr(soot.jimple.NegExpr)
 */
@Override
public void caseNegExpr(NegExpr v) {
    v.getOp().apply(this);
}
项目:jgs    文件:SecurityLevelValueReadSwitch.java   
/**
 * Looks up the <em>security level</em> for the given negation expression
 * and stores the level in {@link SecurityLevelValueReadSwitch#level}.
 * 
 * @param v
 *            The length negation for which the <em>security level</em>
 *            should be looked up.
 * @see soot.jimple.ExprSwitch#caseNegExpr(soot.jimple.NegExpr)
 * @see SecurityLevelValueReadSwitch#handleUnaryOperation(UnopExpr)
 */
@Override
public void caseNegExpr(NegExpr v) {
    handleUnaryOperation(v);
}