예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
 public BranchInfo(ILLocation startLocation, Label endLabel)
 {
     start   = startLocation;
     myLabel = endLabel;
     end     = new ILLocation();
 }