Ejemplo n.º 1
0
        /// <summary>
        /// Realizes a switch instruction.
        /// </summary>
        /// <param name="branchTargets">All switch branch targets.</param>
        private void MakeSwitch(ILInstructionBranchTargets branchTargets)
        {
            var targets = Block.GetBuilderTerminator(branchTargets.Count);

            var switchValue = Block.PopInt(Location, ConvertFlags.TargetUnsigned);

            Builder.CreateSwitchBranch(
                Location,
                switchValue,
                targets);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Realizes a switch instruction.
        /// </summary>
        /// <param name="block">The current basic block.</param>
        /// <param name="builder">The current builder.</param>
        /// <param name="branchTargets">All switch branch targets.</param>
        private static void MakeSwitch(
            Block block,
            IRBuilder builder,
            ILInstructionBranchTargets branchTargets)
        {
            var targets = block.GetBuilderTerminator(branchTargets.Count);

            var switchValue = block.PopInt(ConvertFlags.TargetUnsigned);

            builder.CreateSwitchBranch(switchValue, targets);
        }