/// <summary> /// Add a branch from a location to a target label /// </summary> /// <param name="ilg"></param> /// <param name="target"></param> /// <remarks></remarks> public void AddBranch(YaleIlGenerator ilg, Label target) { var startLoc = new ILLocation(ilg.Length); var branchInfo = new BranchInfo(startLoc, target); branchInfos.Add(branchInfo); }
/// <summary> /// Determine if a branch from a point to a label will be long /// </summary> /// <param name="ilg"></param> /// <param name="target"></param> /// <returns></returns> /// <remarks></remarks> public bool IsLongBranch(YaleIlGenerator ilg, Label target) { var startLoc = new ILLocation(ilg.Length); var branchInfo = new BranchInfo(startLoc, target); var index = branchInfos.IndexOf(branchInfo); branchInfo = branchInfos[index]; return(branchInfo.IsLongBranch); }
public BranchInfo(ILLocation startLocation, Label endLabel) { start = startLocation; myLabel = endLabel; end = new ILLocation(); }