Esempio n. 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(FleeILGenerator ilg, Label target)
        {
            ILLocation startLoc = new ILLocation(ilg.Length);

            BranchInfo bi = new BranchInfo(startLoc, target);

            MyBranchInfos.Add(bi);
        }
Esempio n. 2
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(FleeILGenerator ilg, Label target)
        {
            ILLocation startLoc = new ILLocation(ilg.Length);

            BranchInfo bi = new BranchInfo(startLoc, target);

            // branches will be sorted in order
            MyBranchInfos.Add(bi);
        }
Esempio n. 3
0
 /// <summary>
 /// Find all the branches between the start and end locations of a target branch
 /// </summary>
 /// <param name="target"></param>
 /// <param name="dest"></param>
 /// <remarks></remarks>
 private void FindBetweenBranches(BranchInfo target, ICollection <BranchInfo> dest)
 {
     foreach (BranchInfo bi in MyBranchInfos)
     {
         if (bi.IsBetween(target) == true)
         {
             dest.Add(bi);
         }
     }
 }
Esempio n. 4
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(FleeILGenerator ilg, Label target)
        {
            ILLocation startLoc = new ILLocation(ilg.Length);
            BranchInfo bi       = new BranchInfo(startLoc, target);

            int index = MyBranchInfos.IndexOf(bi);

            bi = MyBranchInfos[index];

            return(bi.IsLongBranch);
        }
Esempio n. 5
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(FleeILGenerator ilg, Label target)
        {
            //return true;
            ILLocation startLoc = new ILLocation(ilg.Length);
            BranchInfo bi       = new BranchInfo(startLoc, target);

            int index = MyBranchInfos.IndexOf(bi);

            if (index > -1 && index < MyBranchInfos.Count)
            {
                bi = MyBranchInfos[index];
            }

            return(bi.IsLongBranch);
        }
Esempio n. 6
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(FleeILGenerator ilg, Label target)
        {
            //return true;
            ILLocation startLoc = new ILLocation(ilg.Length);
            BranchInfo bi       = new BranchInfo(startLoc, target);

            int index = MyBranchInfos.IndexOf(bi);

            if (index > -1 && index < MyBranchInfos.Count)
            {
                bi = MyBranchInfos[index];
                return(bi.IsLongBranch);
            }
            else
            {
                return(true);                // temp fix: not sure why, but MyBranchInfos seems to be missing elements when executing long scripts
            }
        }
Esempio n. 7
0
 public bool IsBetween(BranchInfo other)
 {
     return(_myStart.CompareTo(other._myStart) > 0 && _myStart.CompareTo(other._myEnd) < 0);
 }