Exemplo n.º 1
0
 public void Pass(UncheckedAssembly assembly, out bool changed)
 {
     changed = false;
     foreach (var proc in assembly.Procedures)
     {
         // NOTE: The order is important here, || is lazy!
         changed = Pass(proc) || changed;
     }
 }
Exemplo n.º 2
0
        private bool Pass(UncheckedAssembly assembly, bool first)
        {
            bool changed = false;

            foreach (var pass in Passes)
            {
                if ((pass.IsSinglePass && first) || !pass.IsSinglePass)
                {
                    pass.Pass(assembly, out var passChanged);
                    changed = changed || passChanged;
                }
            }
            return(changed);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Applies the contained <see cref="Passes"/> as long as there are changes found.
        /// </summary>
        /// <param name="assembly">The <see cref="UncheckedAssembly"/> to apply the passes on.</param>
        /// <param name="changed">Outputs true, if the code was changed.</param>
        public void Pass(UncheckedAssembly assembly, out bool changed)
        {
            changed = false;
            bool first = true;

            while (true)
            {
                if (!Pass(assembly, first))
                {
                    break;
                }
                changed = true;
                first   = false;
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Same as <see cref="Pass(Assembly, out bool)"/>.
 /// </summary>
 public void Pass(UncheckedAssembly assembly) => Pass(assembly, out var _);
Exemplo n.º 5
0
 public ValidationContext(UncheckedAssembly assembly)
 {
     Assembly = assembly;
 }