/// <summary>
/// Generates ghost method body that calls <c>this</c> method.
/// </summary>
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);
}