コード例 #1
0
ファイル: RLTransformations.cs プロジェクト: Xtremrules/dot42
        private static IEnumerable<IRLTransformation> GetTransformations(Dex target, MethodBody body)
        {
            foreach (var transformation in optimizations1)
            {
                transformation.Transform(target, body);
                yield return transformation;
            }

            var noopRemove = new NopRemoveTransformation();
            noopRemove.Transform(target, body);
            yield return noopRemove;

            bool hasChanges = true;

            while (hasChanges)
            {
                hasChanges = false;
                foreach (var transformation in incrementalOptimizations)
                {
                    bool changed = transformation.Transform(target, body);
                    if (changed) noopRemove.Transform(target, body);

                    hasChanges = changed || hasChanges;

                    yield return transformation;
                }
            }

            foreach (var transformation in optimizations2)
            {
                transformation.Transform(target, body);
                yield return transformation;
            }    
        }
コード例 #2
0
        private static IEnumerable <IRLTransformation> GetTransformations(Dex target, MethodBody body)
        {
            foreach (var transformation in optimizations1)
            {
                transformation.Transform(target, body);
                yield return(transformation);
            }

            var noopRemove = new NopRemoveTransformation();

            noopRemove.Transform(target, body);
            yield return(noopRemove);

            bool hasChanges = true;

            while (hasChanges)
            {
                hasChanges = false;
                foreach (var transformation in incrementalOptimizations)
                {
                    bool changed = transformation.Transform(target, body);
                    if (changed)
                    {
                        noopRemove.Transform(target, body);
                    }

                    hasChanges = changed || hasChanges;

                    yield return(transformation);
                }
            }

            foreach (var transformation in optimizations2)
            {
                transformation.Transform(target, body);
                yield return(transformation);
            }
        }