public LiveCopyInserter(Procedure proc, SsaIdentifierCollection ssaIds) { this.proc = proc; this.ssaIds = ssaIds; this.sla = new SsaLivenessAnalysis(proc, ssaIds); this.doms = proc.CreateBlockDominatorGraph(); }
public ConditionCodeEliminator(SsaState ssa, IPlatform arch) { this.ssa = ssa; this.ssaIds = ssa.Identifiers; this.platform = arch; this.m = new ExpressionEmitter(); }
public LiveCopyInserter(SsaState ssa) { this.ssa = ssa; this.ssaIds = ssa.Identifiers; this.sla = new SsaLivenessAnalysis(ssa); this.doms = ssa.Procedure.CreateBlockDominatorGraph(); }
public SegmentedAccessClassifier(Procedure proc, SsaIdentifierCollection ssaIds) { this.proc = proc; this.ssaIds = ssaIds; assocs = new Dictionary <Identifier, Identifier>(); consts = new Dictionary <Identifier, Constant>(); }
public static List <Identifier> Find(SsaIdentifierCollection ssaIds, Expression exp) { var inst = new ExpressionIdentifierUseFinder(ssaIds); exp.Accept(inst); return(inst.identifiers); }
public ConditionCodeEliminator(SsaState ssa, IPlatform platform, DecompilerEventListener listener) { this.ssa = ssa; this.ssaIds = ssa.Identifiers; this.platform = platform; this.m = new ExpressionEmitter(); }
public ValuePropagator(SsaIdentifierCollection ssaIds, Procedure proc) { this.ssaIds = ssaIds; this.proc = proc; this.evalCtx = new SsaEvaluationContext(ssaIds); this.eval = new ExpressionSimplifier(evalCtx); }
public IdentifierReplacer(SsaIdentifierCollection ssaIds, Statement use, Identifier idOld, Expression exprNew, bool replaceDefinitions) { this.ssaIds = ssaIds; this.use = use; this.idOld = idOld; this.exprNew = exprNew; this.replaceDefinitions = replaceDefinitions; }
public ExpressionUseRemover(Statement user, SsaIdentifierCollection ssaIds) { if (user == null) { throw new ArgumentNullException("user"); } this.user = user; this.ssaIds = ssaIds; }
public IdentifierTransformer(Identifier id, Statement stm, SsaTransform outer) { this.id = id; this.stm = stm; this.ssaIds = outer.ssa.Identifiers; this.blockstates = outer.blockstates; this.outer = outer; }
public InstructionUseAdder(Statement user, SsaIdentifierCollection ssaIds) { if (user == null) { throw new ArgumentNullException("user"); } this.user = user; this.ssaIds = ssaIds; }
public ConditionCodeEliminator(Program program, SsaState ssa, DecompilerEventListener listener) { this.ssa = ssa; this.ssaIds = ssa.Identifiers; this.program = program; this.listener = listener; this.m = new ExpressionEmitter(); this.aliases = new HashSet <Identifier>(); }
public SsaLivenessAnalysis(Procedure proc, SsaIdentifierCollection ssaIds) { this.proc = proc; this.ssaIds = ssaIds; this.visited = new HashSet <Block>(); BuildRecords(proc.ControlGraph.Blocks); BuildDefinedMap(ssaIds); BuildInterferenceGraph(ssaIds); }
public SsaEvaluationContext( IProcessorArchitecture arch, SsaIdentifierCollection ssaIds, IDynamicLinker dynamicLinker) { this.arch = arch; this.ssaIds = ssaIds; this.dynamicLinker = dynamicLinker; }
public LinearInductionVariableFinder(Procedure proc, SsaIdentifierCollection ssaIds, BlockDominatorGraph doms) { this.proc = proc; this.ssaIds = ssaIds; this.doms = doms; this.ctx = new LinearInductionVariableContext(); this.ivs = new List <LinearInductionVariable>(); this.contexts = new Dictionary <LinearInductionVariable, LinearInductionVariableContext>(); }
public WebBuilder(Procedure proc, SsaIdentifierCollection ssaIds, Dictionary <Identifier, LinearInductionVariable> ivs) { this.proc = proc; this.ssaIds = ssaIds; this.ivs = ivs; this.sla = new SsaLivenessAnalysis(proc, ssaIds); this.doms = proc.CreateBlockDominatorGraph(); this.webs = new List <Web>(); }
public SsaLivenessAnalysis(SsaState ssa) { this.ssa = ssa; this.ssaIds = ssa.Identifiers; this.visited = new HashSet <Block>(); BuildRecords(ssa.Procedure.ControlGraph.Blocks); BuildDefinedMap(ssaIds); BuildInterferenceGraph(ssaIds); }
public SsaEvaluationContext( IProcessorArchitecture arch, SsaIdentifierCollection ssaIds, IImportResolver importResolver) { this.arch = arch; this.ssaIds = ssaIds; this.importResolver = importResolver; }
public WebBuilder(Program program, SsaState ssa, Dictionary <Identifier, LinearInductionVariable> ivs, DecompilerEventListener listener) { this.program = program; this.ssa = ssa; this.ssaIds = ssa.Identifiers; this.ivs = ivs; this.listener = listener; this.sla = new SsaLivenessAnalysis(ssa); this.doms = ssa.Procedure.CreateBlockDominatorGraph(); this.webs = new List <Web>(); }
public SsaLivenessAnalysis(SsaState ssa) { this.ssaIds = ssa.Identifiers; this.visited = new HashSet <Block>(); this.records = new Dictionary <Block, Record>(); this.defined = new Dictionary <Statement, List <Identifier> >(); this.interference = new InterferenceGraph(); BuildRecords(ssa.Procedure.ControlGraph.Blocks); BuildDefinedMap(ssaIds); BuildInterferenceGraph(ssaIds); }
public TrashedRegisterFinder2( IProcessorArchitecture arch, ProgramDataFlow flow, Procedure proc, SsaIdentifierCollection ssa, DecompilerEventListener listener) { this.arch = arch; this.progFlow = flow; this.proc = proc; this.ssa = ssa; this.decompilerEventListener = listener; this.flow = new ProcedureFlow2(); }
public void BuildDefinedMap(SsaIdentifierCollection ssaIds) { foreach (SsaIdentifier ssa in ssaIds) { if (ssa.Uses.Count > 0 && ssa.DefStatement != null) { if (!defined.TryGetValue(ssa.DefStatement, out List <Identifier> al)) { al = new List <Identifier>(); defined.Add(ssa.DefStatement, al); } al.Add(ssa.Identifier); } } }
public void BuildInterferenceGraph(SsaIdentifierCollection ssaIds) { foreach (SsaIdentifier v in ssaIds) { visited.Clear(); foreach (Statement s in v.Uses) { PhiFunction?phi = GetPhiFunction(s); if (phi != null) { var p = phi.Arguments.First(e => e.Value == v.Identifier).Block; LiveOutAtBlock(p, v); } else { int i = s.Block.Statements.IndexOf(s); LiveInAtStatement(s.Block, i, v); } } } }
public ValueNumbering(SsaIdentifierCollection ssaIds) { this.ssaIds = ssaIds; optimistic = new Dictionary <Expression, Expression>(); valid = new Dictionary <Expression, Expression>(); stack = new Stack <Node>(); // Set initial value numbers for all nodes (SSA identifiers). // Value numbers for the original values at procedure entry are just the // SSA identifiers, while any other values are undefined. AssignInitialValueNumbers(); // Walk the SCC's of the node graph using Tarjan's algorithm. iDFS = 0; foreach (var id in nodes.Keys) { DFS(id); } }
public void BuildInterferenceGraph(SsaIdentifierCollection ssaIds) { interference = new InterferenceGraph(); foreach (SsaIdentifier v in ssaIds) { visited = new HashSet <Block>(); foreach (Statement s in v.Uses) { PhiFunction phi = GetPhiFunction(s); if (phi != null) { int i = Array.IndexOf(phi.Arguments, v.Identifier); Block p = s.Block.Pred[i]; LiveOutAtBlock(p, v); } else { int i = s.Block.Statements.IndexOf(s); LiveInAtStatement(s.Block, i, v); } } } }
public SsaState(Procedure proc, DominatorGraph <Block> domGraph) { this.Procedure = proc; this.DomGraph = domGraph; this.ids = new SsaIdentifierCollection(); }
public SsaGraph(SsaIdentifierCollection ssaIds) { this.ssaIds = ssaIds; }
public ExpressionUseRemover(Statement user, SsaIdentifierCollection ssaIds) { this.user = user ?? throw new ArgumentNullException(nameof(user)); this.ssaIds = ssaIds; }
public OutParameterTransformer(Procedure proc, SsaIdentifierCollection ssaIds) { this.proc = proc; this.ssaIds = ssaIds; }
public GrfDefinitionFinder(SsaIdentifierCollection ssaIds) { this.ssaIds = ssaIds; }