public bool WasUsed(Instruction instr, Identifier id) { this.id = id; this.wasUsed = false; instr.Accept(this); return(wasUsed); }
/// <summary> /// Given a procedure in SSA form, converts it back to "normal" form. /// </summary> /// <param name="renameVariables"></param> public void ConvertBack(bool renameVariables) { UnSSA unssa = new UnSSA(this); foreach (Block block in Procedure.ControlGraph.Blocks) { for (int st = 0; st < block.Statements.Count; ++st) { Instruction instr = block.Statements[st].Instruction; if (instr is PhiAssignment || instr is DefInstruction) { block.Statements.RemoveAt(st); --st; } else if (renameVariables) { instr.Accept(unssa); } } } // Remove any instructions in the return block, used only // for computation of reaching definitions. Procedure.ExitBlock.Statements.Clear(); }
public void EnableInstructionOnly_AllElementStateCorrect() { var revealInstruction = new Revealer(); _instruction.Accept(revealInstruction); Assert.False(_mario.Active); Assert.False(_luigi.Active); Assert.True(_instruction.Active); }
/// <summary> /// For each statement in the procedure, traverse any defined operands. Upon /// encountering, add alias statements for all the known aliases. /// We do this in reverse order, calculating at the same time the deadness /// of all registers. We may not need to generate an alias if the /// register is dead. /// </summary> /// <param name="proc"></param> public void Transform() { foreach (var block in proc.ControlGraph.Blocks) { StartBlock(block); for (iStm = block.Statements.Count - 1; iStm >= 0; --iStm) { Instruction instr = block.Statements[iStm].Instruction; instr.Accept(this); } } }
private static int GetNumberPushedByInstruction(Instruction current) { return(current.Accept(new NumberPushedVisitor())); }
public bool Match(Instruction instr) { matcher.Clear(); return(instr.Accept(this)); }
public Instruction ReplaceIdentifiers(Instruction instr) { return(instr.Accept(this)); }
public string Visit(Instruction instruction) { return(instruction.Accept(this)); }
public bool IsCritical(Instruction instr) { isCritical = false; instr.Accept(this); return(isCritical); }
public SideEffectFlags FindSideEffect(Instruction instr) { flags = SideEffectFlags.None; instr.Accept(this); return(flags); }
public void Visit(Instruction instruction) { instruction.Accept(this); }
public SideEffectFlags FindSideEffect(Instruction instr) { flags = SideEffectFlags.None; instr.Accept(this); return flags; }
public bool IsCritical(Instruction instr) { isCritical = false; instr.Accept(this); return isCritical; }
public ISet <VariableDescriptor> Visit(Instruction instruction) { return(instruction.Accept(this)); }
public void Visit(Instruction node) { node.Accept(this); }