/// <summary>
        ///  Dumps the linear ir representation of a method to stdout.
        /// </summary>
        public void Dump(IrPrintingPolicy printingPolicy)
        {
            var @out = Console.Out;

            @out.WriteLine(printingPolicy.IndentationString + MethodDefinition.FullName);
            @out.WriteLine(printingPolicy.IndentationString + "{");
            printingPolicy.IncrementIndentation();
            foreach (var instruction in this.Instructions)
            {
                instruction.Dump(printingPolicy);
                @out.WriteLine();
            }
            printingPolicy.DecrementIndentation();
            @out.WriteLine(printingPolicy.IndentationString + "}");
        }
Example #2
0
        /// <summary>
        ///   Dumps linear ir for a type definition.
        /// </summary>
        public void Dump(TypeDefinition typeDefinition)
        {
            var @out = Console.Out;

            @out.WriteLine(typeDefinition.FullName);
            @out.WriteLine("{");
            IrPrintingPolicy.IncrementIndentation();
            foreach (var methodDefinition in typeDefinition.Methods.Where(x => x.HasBody))
            {
                Dump(methodDefinition);
                @out.WriteLine();
            }
            IrPrintingPolicy.DecrementIndentation();
            @out.WriteLine("}");
        }