Пример #1
0
        /// <summary>
        /// Sets the branch target.
        /// </summary>
        /// <param name="block">The basic block.</param>
        public void AddBranchTarget(BasicBlock block)
        {
            Debug.Assert(block != null);

            (branchTargets ?? (branchTargets = new List <BasicBlock>(1))).Add(block);

            Block?.AddBranchInstruction(this);
        }
Пример #2
0
		public void UpdateBranchTarget(int index, BasicBlock block)
		{
			// no change, skip update
			if (branchTargets[index] == block)
				return;

			Block.RemoveBranchInstruction(this);

			branchTargets[index] = block;

			Block.AddBranchInstruction(this);
		}
Пример #3
0
        /// <summary>
        /// Sets the branch target.
        /// </summary>
        /// <param name="block">The basic block.</param>
        public void AddBranchTarget(BasicBlock block)
        {
            Debug.Assert(block != null);

            if (branchTargets == null)
            {
                branchTargets = new List <BasicBlock>(1);
            }

            branchTargets.Add(block);

            if (Block != null)
            {
                Block.AddBranchInstruction(this);
            }
        }