Search in sources :

Example 86 with Expr

use of org.mapleir.ir.code.Expr in project maple-ir by LLVM-but-worse.

the class SSAGenPass method collectUses.

private void collectUses(Expr e) {
    for (Expr c : e.enumerateWithSelf()) {
        if (c.getOpcode() == Opcode.LOCAL_LOAD) {
            VarExpr ve = (VarExpr) c;
            pool.uses.get(ve.getLocal()).add(ve);
        }
    }
}
Also used : ConstantExpr(org.mapleir.ir.code.expr.ConstantExpr) InitialisedObjectExpr(org.mapleir.ir.code.expr.invoke.InitialisedObjectExpr) InvocationExpr(org.mapleir.ir.code.expr.invoke.InvocationExpr) VarExpr(org.mapleir.ir.code.expr.VarExpr) Expr(org.mapleir.ir.code.Expr) PhiExpr(org.mapleir.ir.code.expr.PhiExpr) VarExpr(org.mapleir.ir.code.expr.VarExpr)

Example 87 with Expr

use of org.mapleir.ir.code.Expr in project maple-ir by LLVM-but-worse.

the class SSAGenPass method getValue.

private Expr getValue(Expr e) {
    if (e.getOpcode() == Opcode.LOCAL_LOAD) {
        VarExpr v = (VarExpr) e;
        AbstractCopyStmt def = pool.defs.get(v.getLocal());
        Expr val = def.getExpression();
        if (!def.isSynthetic() && def.getOpcode() != Opcode.PHI_STORE) {
            return getValue(val);
        }
    }
    return e;
}
Also used : ConstantExpr(org.mapleir.ir.code.expr.ConstantExpr) InitialisedObjectExpr(org.mapleir.ir.code.expr.invoke.InitialisedObjectExpr) InvocationExpr(org.mapleir.ir.code.expr.invoke.InvocationExpr) VarExpr(org.mapleir.ir.code.expr.VarExpr) Expr(org.mapleir.ir.code.Expr) PhiExpr(org.mapleir.ir.code.expr.PhiExpr) VarExpr(org.mapleir.ir.code.expr.VarExpr) AbstractCopyStmt(org.mapleir.ir.code.stmt.copy.AbstractCopyStmt)

Aggregations

Expr (org.mapleir.ir.code.Expr)87 VarExpr (org.mapleir.ir.code.expr.VarExpr)46 InvocationExpr (org.mapleir.ir.code.expr.invoke.InvocationExpr)45 BasicBlock (org.mapleir.ir.cfg.BasicBlock)32 PhiExpr (org.mapleir.ir.code.expr.PhiExpr)31 Stmt (org.mapleir.ir.code.Stmt)29 ConstantExpr (org.mapleir.ir.code.expr.ConstantExpr)26 AbstractCopyStmt (org.mapleir.ir.code.stmt.copy.AbstractCopyStmt)26 Local (org.mapleir.ir.locals.Local)22 Type (org.objectweb.asm.Type)21 VersionedLocal (org.mapleir.ir.locals.impl.VersionedLocal)20 CopyPhiStmt (org.mapleir.ir.code.stmt.copy.CopyPhiStmt)19 InitialisedObjectExpr (org.mapleir.ir.code.expr.invoke.InitialisedObjectExpr)17 ComparisonType (org.mapleir.ir.code.stmt.ConditionalJumpStmt.ComparisonType)14 CopyVarStmt (org.mapleir.ir.code.stmt.copy.CopyVarStmt)14 ValueComparisonType (org.mapleir.ir.code.expr.ComparisonExpr.ValueComparisonType)13 ArrayType (org.mapleir.ir.TypeUtils.ArrayType)12 HashSet (java.util.HashSet)11 ArithmeticExpr (org.mapleir.ir.code.expr.ArithmeticExpr)11 ControlFlowGraph (org.mapleir.ir.cfg.ControlFlowGraph)9