public static MethodDefinition GetOrCreateStaticConstructor(this TypeDefinition type)
{
var cctor = type.GetStaticConstructor();
if (cctor != null) return cctor;
cctor = new MethodDefinition(".cctor", _staticConstructorAttributes, type.Module.Import(typeof(void)));
type.Methods.Add(cctor);
var il = cctor.Body.GetILProcessor();
il.Emit(OpCodes.Ret);
return cctor;
}