internal CodeGenContext(CodeGenContext context) { this.Assembly = context.Assembly; this.Method = context.Method; this.CLRLocals = context.CLRLocals; this.labels = context.labels; this.CurrentRubyClass = context.CurrentRubyClass; this.orig_func = context.orig_func; // BBTAG this.orig_func_formals = context.orig_func_formals; // BBTAG this.currentSkeleton = context.currentSkeleton; // BBTAG this.postPassList = context.postPassList; // BBTAG this.peFiles = context.peFiles; // BBTAG }
internal CodeGenContext CreateModuleMethod(string name, PERWAPI.Type return_type, params Param[] parameters) { CodeGenContext newContext = new CodeGenContext(this); newContext.Method = Assembly.AddMethod(MethAttr.PublicStatic, ImplAttr.IL, name, return_type, parameters); newContext.CLRLocals = new List<Local>(); newContext.Method.CreateCodeBuffer(); newContext.buffer.OpenScope(); return newContext; }
internal CodeGenContext CreateMethod(ClassDef ParentClass, MethAttr attr, string name, PERWAPI.Type return_type, params Param[] parameters) { CodeGenContext newContext = new CodeGenContext(this); newContext.Method = ParentClass.AddMethod(attr, ImplAttr.IL, name, return_type, parameters); if ((attr & MethAttr.Static) == 0) newContext.Method.AddCallConv(CallConv.Instance); newContext.CLRLocals = new List<Local>(); newContext.Method.CreateCodeBuffer(); newContext.buffer.OpenScope(); return newContext; }