Given a procedure, coalesces any compound conditions found.
A compound condition is expressed in C as a && b or a || b
Пример #1
0
 public void Structure()
 {
     var ccc = new CompoundConditionCoalescer(proc);
     ccc.Transform();
     var reg = Execute();
     //$REVIEW: yeecch. Should return the statements, and 
     // caller decides what to do with'em. Probably 
     // return an abstract Procedure, rather than overloading
     // the IR procedure.
     proc.Body.AddRange(reg.Statements);
 }
		private void RunTest(string sourceFilename, string outFilename)
		{
			using (FileUnitTester fut = new FileUnitTester(outFilename))
			{
				RewriteProgramMsdos(sourceFilename, Address.SegPtr(0xC00, 0));
				foreach (Procedure proc in program.Procedures.Values)
				{
					proc.Write(false, fut.TextWriter);
					fut.TextWriter.WriteLine();

					CompoundConditionCoalescer ccc = new CompoundConditionCoalescer(proc);
					ccc.Transform();
					proc.Write(false, fut.TextWriter);
					fut.TextWriter.WriteLine("================");
				}

				fut.AssertFilesEqual();
			}
		}
Пример #3
0
        private void CoalesceCompoundConditions()
        {
            var ccc = new CompoundConditionCoalescer(proc);

            ccc.Transform();
        }
Пример #4
0
 private void CoalesceCompoundConditions()
 {
     var ccc = new CompoundConditionCoalescer(proc);
     ccc.Transform();
 }