private void Dump(bool enable, string s, HashSet <RegisterStorage> a) { if (enable) { StringWriter sw = new StringWriter(); sw.Write("{0}: ", s); ProcedureFlow.EmitRegisters(program.Architecture, "", a, sw); Debug.WriteLine(sw.ToString()); } }
/// <summary> /// When liveness analysis reaches the entry block of the procedure, /// update the procedure summary information with the current set of /// live registers. /// </summary> /// <param name="p"></param> public void PropagateToProcedureSummary(IdentifierLiveness varLive, Procedure p) { ProcedureFlow flow = mpprocData[p]; state.ApplySavedRegisters(flow, varLive); var change = MergeIntoProcedureFlow(varLive, flow); if (change) { Debug.WriteLineIf(trace.TraceInfo, flow.EmitRegisters(program.Architecture, p.Name + " summary:", flow.Summary)); state.UpdateSummary(flow); foreach (Statement stmCaller in program.CallGraph.CallerStatements(p)) { Debug.WriteLineIf(trace.TraceVerbose, string.Format("Propagating to {0} (block {1} in {2}", stmCaller.Instruction.ToString(), stmCaller.Block.Name, stmCaller.Block.Procedure.Name)); worklist.Add(mpprocData[stmCaller.Block]); } } }