Mosa.Compiler.Framework.InstructionNode.Replace C# (CSharp) Method

Replace() public method

Replaces the specified node with the given node, the existing node is invalid afterwards
public Replace ( InstructionNode node ) : void
node InstructionNode The node.
return void
        public void Replace(InstructionNode node)
        {
            //Block.DebugCheck();

            Debug.Assert(!IsBlockStartInstruction);
            Debug.Assert(!IsBlockEndInstruction);
            Debug.Assert(!node.IsBlockStartInstruction);
            Debug.Assert(!node.IsBlockEndInstruction);

            node.Label = Label;

            node.Previous = Previous;
            node.Next = Next;

            node.Previous.Next = node;
            node.Next.Previous = node;

            // clear operations
            ClearOperands();
            Instruction = null;

            //Block.DebugCheck();
        }