コード例 #1
0
        private bool ApplyTransformations(Context context, int id)
        {
            var instructionTransformations = transformations[id];

            if (instructionTransformations == null)
            {
                return(false);
            }

            int count = instructionTransformations.Count;

            for (int i = 0; i < count; i++)
            {
                var transformation = instructionTransformations[i];

                var updated = TransformContext.ApplyTransform(context, transformation);

                if (updated)
                {
                    OptimizationsCount.Increment();

                    if (CompilerSettings.FullCheckMode)
                    {
                        CheckAllPhiInstructions();
                    }

                    return(true);
                }
            }

            return(false);
        }
コード例 #2
0
        private bool ApplyTransformations(Context context, TransformContext transformContext, int id)
        {
            var instructionTransformations = transformations[id];

            if (instructionTransformations == null)
            {
                return(false);
            }

            int count = instructionTransformations.Count;

            for (int i = 0; i < count; i++)
            {
                var transformation = instructionTransformations[i];

                var updated = transformContext.ApplyTransform(context, transformation);

                if (updated)
                {
                    OptimizationsCount.Increment();
                    return(true);
                }
            }

            return(false);
        }