public bool VisitIf(RtlIf rtlIf) { var pIf = pattern as RtlIf; if (pIf == null) return false; var p = pattern; pattern = pIf.Instruction; var ret = rtlIf.Instruction.Accept(this); pattern = p; return ret; }
public bool VisitIf(RtlIf rtlIf) { if (!(pattern is RtlIf pIf)) { return(false); } var p = pattern; pattern = pIf.Instruction; var ret = rtlIf.Instruction.Accept(this); pattern = p; return(ret); }
public bool Match(RtlInstruction instr) { matcher.Clear(); return(instr.Accept(this)); }
public RtlInstructionMatcher(RtlInstruction pattern) { this.pattern = pattern; this.matcher = new ExpressionMatcher(null !); }
/// <summary> /// Builds an RTL If instruction, which executes the specified statement /// only if the condition is satisfied. The annulled flag is used to model /// processor architectures like SPARC, where there is a delay slot after a /// branch, and annullment allows the delay slot to not be executed if the /// branch is not taken. /// </summary> /// <param name="condition"></param> /// <param name="instr"></param> /// <param name="annulled"></param> public RtlIf(Expression condition, RtlInstruction instr) { this.Condition = condition; this.Instruction = instr; this.Class = instr.Class | InstrClass.Conditional; }
public RtlEmitter If(Expression test, RtlInstruction rtl) { instrs.Add(new RtlIf(test, rtl)); return(this); }
public void Emit(RtlInstruction instr) { instrs.Add(instr); }