public bool Flag; // toggled to mark reachability public Line([CanBeNull] ILabel label, TCode code, [CanBeNull] ILabel target, PeepholeLineType type) { Label = label; Code = code; TargetLabel = target; Type = type; }
public CombinableLine(ILabel label, TCode code, ILabel target, PeepholeLineType type) : this() { Label = label; Code = code; Target = target; Type = type; }
public void CopyFrom([NotNull] Line other) { Label = other.Label; Code = other.Code; TargetLabel = other.TargetLabel; Type = other.Type; TargetLine = other.TargetLine; Flag = other.Flag; }
static PeepholeLineType InvertBranch(PeepholeLineType type) { switch (type) { case PeepholeLineType.BranchPositive: return(PeepholeLineType.BranchNegative); case PeepholeLineType.BranchNegative: return(PeepholeLineType.BranchPositive); default: throw new ArgumentOutOfRangeException(); } }
/// <summary> /// Adds an instruction to the buffer. /// </summary> /// <param name="code">The instruction.</param> /// <param name="target">The target label of this instruction, or null.</param> /// <param name="type">The type of instruction.</param> public void AddLine(TCode code, [CanBeNull] ILabel target, PeepholeLineType type) { lines.AddLast(new Line(pendingLabel, code, target, type)); pendingLabel = null; }
static bool IsInvertibleBranch(PeepholeLineType type) { return(type == PeepholeLineType.BranchNegative || type == PeepholeLineType.BranchPositive); }