Пример #1
0
        public static string GetDump(ControlFlowGraph cfg)
        {
            var dumper = new IRDumper(1);

            for (BasicBlock block = cfg.Blocks.First; block != null; block = block.ListNext)
            {
                dumper.Indent();
                dumper.DumpBlockHeader(block);

                dumper._builder.AppendLine();

                dumper.IncreaseIndentation();

                for (Node node = block.Operations.First; node != null; node = node.ListNext)
                {
                    dumper.Indent();
                    dumper.DumpNode(node);

                    dumper._builder.AppendLine();
                }

                dumper.DecreaseIndentation();
            }

            return(dumper._builder.ToString());
        }
Пример #2
0
        public static void EndPass(PassName name, ControlFlowGraph cfg)
        {
            EndPass(name);

            WriteOutput("IR after " + name + " pass:");

            WriteOutput(IRDumper.GetDump(cfg));
        }