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;
}