Esempio n. 1
0
        /// <summary>
        /// Visitation function for <see cref="IR.IIRVisitor.ReturnInstruction"/> instruction.
        /// </summary>
        /// <param name="ctx">The context.</param>
        void IR.IIRVisitor.ReturnInstruction(Context ctx)
        {
            Operand op = ctx.Operand1;

            if (op != null)
            {
                ICallingConvention cc = Architecture.GetCallingConvention(MethodCompiler.Method.Signature.CallingConvention);
                cc.MoveReturnValue(ctx, op);
                ctx.AppendInstruction(CPUx86.Instruction.JmpInstruction);
                ctx.SetBranch(Int32.MaxValue);
            }


            else
            {
                ctx.SetInstruction(CPUx86.Instruction.JmpInstruction);
                ctx.SetBranch(Int32.MaxValue);
            }
        }