Exemplo n.º 1
0
            public void OutputEntireNode()
            {
                CFG.CFGVertex v = this;
                System.Console.WriteLine();
                System.Console.WriteLine("Node: " + v.Name + " ");
                System.Console.WriteLine(new String(' ', 4) + "Method " + v.Method.FullName);
                System.Console.WriteLine(new String(' ', 4) + "Args   " + v.NumberOfArguments);
                System.Console.WriteLine(new String(' ', 4) + "Locals " + v.NumberOfLocals);
                System.Console.WriteLine(new String(' ', 4) + "Return (reuse) " + v.HasReturnValue);
                System.Console.WriteLine(new String(' ', 4) + "Stack level in " + v.StackLevelIn);
                System.Console.WriteLine(new String(' ', 4) + "Stack level out " + v.StackLevelOut);
                if (this._Graph.Predecessors(v.Name).Any())
                {
                    System.Console.Write(new String(' ', 4) + "Edges from:");
                    foreach (object t in this._Graph.Predecessors(v.Name))
                    {
                        System.Console.Write(" " + t);
                    }
                    System.Console.WriteLine();
                }
                if (this._Graph.Successors(v.Name).Any())
                {
                    System.Console.Write(new String(' ', 4) + "Edges to:");
                    foreach (object t in this._Graph.Successors(v.Name))
                    {
                        System.Console.Write(" " + t);
                    }
                    System.Console.WriteLine();
                }
                System.Console.WriteLine(new String(' ', 4) + "Instructions:");
                SSA ssa = SSA.Singleton();

                //if (v.StateIn != null)
                //{
                //    System.Console.WriteLine("State in");
                //    v.StateIn.Dump();
                //}
                foreach (Inst i in v._instructions)
                {
                    //if (i.StateIn != null)
                    //    i.StateIn.Dump();

                    System.Console.Write(new String(' ', 8) + i + new String(' ', 4));

                    if (ssa._operation.ContainsKey(i))
                    {
                        foreach (SSA.Operation o in ssa._operation[i])
                        {
                            System.Console.Write(" [" + o + "]");
                        }
                    }

                    System.Console.WriteLine();
                }

                //if (v.StateOut != null)
                //{
                //    System.Console.WriteLine("State out");
                //    v.StateOut.Dump();
                //}
                System.Console.WriteLine();
            }