public void AddBranch(FleeIlGenerator ilg, Label target) { var startLoc = new IlLocation(ilg.Length); var bi = new BranchInfo(startLoc, target); this.myBranchInfos.Add(bi); }
private void FindBetweenBranches(BranchInfo target, ICollection <BranchInfo> dest) { this.myBranchInfos.Each(m => { if (m.IsBetween(target)) { dest.Add(m); } }); //try //{ // var enumerator = this.myBranchInfos.GetEnumerator(); // while (enumerator.MoveNext()) // { // var bi = enumerator.Current; // var flag = bi.IsBetween(target); // if (flag) // { // dest.Add(bi); // } // } //} //finally //{ // IEnumerator<BranchInfo> enumerator; // if (enumerator != null) // { // enumerator.Dispose(); // } //} }
public bool IsLongBranch(FleeIlGenerator ilg, Label target) { var startLoc = new IlLocation(ilg.Length); var bi = new BranchInfo(startLoc, target); var index = this.myBranchInfos.IndexOf(bi); bi = this.myBranchInfos[index]; return(bi.IsLongBranch); }