public string EmitFlagGroup(IProcessorArchitecture arch, string caption, uint grfFlags) { StringWriter sw = new StringWriter(); EmitFlagGroup(arch, caption, grfFlags, sw); return(sw.ToString()); }
public string EmitFlagGroup(IProcessorArchitecture arch, string caption, Dictionary <RegisterStorage, uint> grfFlags) { StringWriter sw = new StringWriter(); EmitFlagGroup(arch, caption, grfFlags, sw); return(sw.ToString()); }
public string EmitRegisters(IProcessorArchitecture arch, string caption, HashSet <RegisterStorage> regs) { StringWriter sw = new StringWriter(); EmitRegisters(arch, caption, regs, sw); return(sw.ToString()); }
private static void EmitRegistersCore(IProcessorArchitecture arch, HashSet <RegisterStorage> regs, TextWriter sb) { foreach (var reg in regs.Where(r => r != null).OrderBy(r => r.Name)) { sb.Write(" "); sb.Write(reg.Name); } }
public static void EmitRegisters(IProcessorArchitecture arch, string caption, uint grfFlags, HashSet <RegisterStorage> regs, TextWriter sb) { sb.Write(caption); if (grfFlags != 0) { sb.Write(" {0}", arch.GrfToString(grfFlags)); } EmitRegistersCore(arch, regs, sb); }
public void EmitFlagGroup(IProcessorArchitecture arch, string caption, Dictionary <RegisterStorage, uint> flagRegs, TextWriter sb) { sb.Write(caption); foreach (var freg in flagRegs .Select(f => arch.GetFlagGroup(f.Key, f.Value) !) .OrderBy(f => f.Name)) { sb.Write(" {0}", freg.Name); } }
/// <summary> /// Writes flow state that is true on exit from the basic block. /// </summary> /// <param name="arch"></param> /// <param name="writer"></param> public void WriteAfter(IProcessorArchitecture arch, TextWriter writer) { EmitRegisters(arch, "// DataOut:", DataOut, writer); writer.WriteLine(); EmitFlagGroup(arch, "// DataOut (flags):", grfOut, writer); writer.WriteLine(); EmitLocals("// LocalsOut:", writer); if (TerminatesProcess) { writer.WriteLine("// Terminates process"); } }
public static void EmitRegisters(IProcessorArchitecture arch, string caption, Dictionary <RegisterStorage, uint> grfFlags, IEnumerable <Storage> regs, TextWriter sb) { sb.Write(caption); var sGrf = string.Join(" ", grfFlags .Where(f => f.Value != 0) .Select(f => arch.GetFlagGroup(f.Key, f.Value) !) .OrderBy(f => f.Name)); if (sGrf.Length > 0) { sb.Write(" {0}", sGrf); } EmitRegistersCore(regs, sb); }
public override void Emit(IProcessorArchitecture arch, TextWriter writer) { EmitRegisters(arch, "// DataOut:", DataOut, writer); writer.WriteLine(); EmitFlagGroup(arch, "// DataOut (flags):", grfOut, writer); writer.WriteLine(); SymbolicIn.Emit(arch, "// SymbolicIn:", writer); writer.WriteLine(); EmitLocals("// LocalsOut:", writer); if (TerminatesProcess) { writer.WriteLine("// Terminates process"); } }
public static void EmitRegisters(IProcessorArchitecture arch, string caption, Dictionary <RegisterStorage, uint> grfFlags, IDictionary <Storage, BitRange> regRanges, TextWriter sb) { sb.Write(caption); var sGrf = string.Join(" ", grfFlags .Where(f => f.Value != 0) .Select(f => arch.GetFlagGroup(f.Key, f.Value) !) .OrderBy(f => f.Name)); if (sGrf.Length > 0) { sb.Write(" {0}", sGrf); } foreach (var de in regRanges.OrderBy(de => de.Key.Name)) { sb.Write(" {0}:{1}", de.Key, de.Value); } }
public void EmitFlagGroup(IProcessorArchitecture arch, string caption, uint grfFlags, TextWriter sb) { sb.Write(caption); sb.Write(" {0}", arch.GrfToString(grfFlags)); }
public static void EmitRegisters(IProcessorArchitecture arch, string caption, HashSet <RegisterStorage> regs, TextWriter sb) { sb.Write(caption); EmitRegistersCore(arch, regs, sb); }
/// <summary> /// Displays the dataflow object as a human-readable stream of text. /// </summary> /// <param name="arch">current processor architecture (to interpret registers)</param> /// <param name="sb">stream into which the data is written</param> public abstract void Emit(IProcessorArchitecture arch, TextWriter sb);
/// <summary> /// Writes flow state that is true on entry to the basic block. /// </summary> /// <param name="arch"></param> /// <param name="writer"></param> public void WriteBefore(IProcessorArchitecture arch, TextWriter writer) { SymbolicIn.Emit(arch, "// SymbolicIn:", writer); writer.WriteLine(); }