Exemplo n.º 1
0
        /// <summary>
        /// Appends a new instruction to the end of this basic block.
        /// Returns the instruction builder for the inserted instruction.
        /// </summary>
        /// <param name="instruction">The instruction to append.</param>
        /// <param name="tag">The instruction's tag.</param>
        /// <returns>The appended instruction.</returns>
        public NamedInstructionBuilder AppendInstruction(Instruction instruction, ValueTag tag)
        {
            var selInsn = ImmutableBlock.AppendInstruction(instruction, tag);

            Graph.ImmutableGraph = selInsn.Block.Graph;
            return(Graph.GetInstruction(selInsn.Tag));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Inserts a new instruction into this basic block's list of instructions.
        /// Returns the instruction builder for the inserted instruction.
        /// </summary>
        /// <param name="index">The index to insert the instruction at.</param>
        /// <param name="instruction">The instruction to insert.</param>
        /// <param name="tag">The instruction's tag.</param>
        /// <returns>The inserted instruction.</returns>
        public NamedInstructionBuilder InsertInstruction(int index, Instruction instruction, ValueTag tag)
        {
            var selInsn = ImmutableBlock.InsertInstruction(index, instruction, tag);

            Graph.ImmutableGraph = selInsn.Block.Graph;
            return(Graph.GetInstruction(selInsn.Tag));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Appends a new parameter to the end of this basic block's parameter list.
 /// </summary>
 /// <param name="parameter">The parameter to append.</param>
 /// <returns>The block parameter.</returns>
 public BlockParameter AppendParameter(BlockParameter parameter)
 {
     Graph.ImmutableGraph = ImmutableBlock.AppendParameter(parameter).Graph;
     return(parameter);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Removes the instruction with a particular tag from
 /// this basic block.
 /// </summary>
 /// <param name="tag">The tag of the instruction to remove.</param>s
 public void RemoveInstruction(ValueTag tag)
 {
     Graph.ImmutableGraph = ImmutableBlock.RemoveInstruction(tag).Graph;
 }