Pchp.CodeAnalysis.Symbols.SourceRoutineSymbol.GenerateGhostBody C# (CSharp) Method

GenerateGhostBody() protected method

Generates ghost method body that calls this method.
protected GenerateGhostBody ( PEModuleBuilder module, DiagnosticBag diagnostic, SynthesizedMethodSymbol ghost ) : void
module PEModuleBuilder
diagnostic DiagnosticBag
ghost SynthesizedMethodSymbol
return void
        protected void GenerateGhostBody(PEModuleBuilder module, DiagnosticBag diagnostic, SynthesizedMethodSymbol ghost)
        {
            var body = MethodGenerator.GenerateMethodBody(module, ghost,
                (il) =>
                {
                    var cg = new CodeGenerator(il, module, diagnostic, OptimizationLevel.Release, false, this.ContainingType, this.GetContextPlace(), this.GetThisPlace());

                    // return (T){routine}(p0, ..., pN);
                    cg.EmitConvert(cg.EmitThisCall(this, ghost), 0, ghost.ReturnType);
                    cg.EmitRet(ghost.ReturnType);
                },
                null, diagnostic, false);

            module.SetMethodBody(ghost, body);
        }
    }