+ class PredefinedMembers
+ {
+ public readonly PredefinedMember<MethodSpec> ActivatorCreateInstance;
+ public readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderCreate;
+ public readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderSetResult;
+ public readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderSetException;
+ public readonly PredefinedMember<PropertySpec> AsyncTaskMethodBuilderTask;
+ public readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderGenericCreate;
+ public readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderGenericSetResult;
+ public readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderGenericSetException;
+ public readonly PredefinedMember<PropertySpec> AsyncTaskMethodBuilderGenericTask;
+ public readonly PredefinedMember<MethodSpec> AsyncVoidMethodBuilderCreate;
+ public readonly PredefinedMember<MethodSpec> AsyncVoidMethodBuilderSetException;
+ public readonly PredefinedMember<MethodSpec> AsyncVoidMethodBuilderSetResult;
+ public readonly PredefinedMember<MethodSpec> DecimalCtor;
+ public readonly PredefinedMember<MethodSpec> DecimalCtorInt;
+ public readonly PredefinedMember<MethodSpec> DecimalCtorLong;
+ public readonly PredefinedMember<MethodSpec> DecimalConstantAttributeCtor;
+ public readonly PredefinedMember<MethodSpec> DefaultMemberAttributeCtor;
+ public readonly PredefinedMember<MethodSpec> DelegateCombine;
+ public readonly PredefinedMember<MethodSpec> DelegateEqual;
+ public readonly PredefinedMember<MethodSpec> DelegateInequal;
+ public readonly PredefinedMember<MethodSpec> DelegateRemove;
+ public readonly PredefinedMember<MethodSpec> DynamicAttributeCtor;
+ public readonly PredefinedMember<MethodSpec> FieldInfoGetFieldFromHandle;
+ public readonly PredefinedMember<MethodSpec> FieldInfoGetFieldFromHandle2;
+ public readonly PredefinedMember<MethodSpec> IDisposableDispose;
+ public readonly PredefinedMember<MethodSpec> IEnumerableGetEnumerator;
+ public readonly PredefinedMember<MethodSpec> InterlockedCompareExchange;
+ public readonly PredefinedMember<MethodSpec> InterlockedCompareExchange_T;
+ public readonly PredefinedMember<MethodSpec> FixedBufferAttributeCtor;
+ public readonly PredefinedMember<MethodSpec> MethodInfoGetMethodFromHandle;
+ public readonly PredefinedMember<MethodSpec> MethodInfoGetMethodFromHandle2;
+ public readonly PredefinedMember<MethodSpec> MonitorEnter;
+ public readonly PredefinedMember<MethodSpec> MonitorEnter_v4;
+ public readonly PredefinedMember<MethodSpec> MonitorExit;
+ public readonly PredefinedMember<PropertySpec> RuntimeCompatibilityWrapNonExceptionThrows;
+ public readonly PredefinedMember<MethodSpec> RuntimeHelpersInitializeArray;
+ public readonly PredefinedMember<PropertySpec> RuntimeHelpersOffsetToStringData;
+ public readonly PredefinedMember<ConstSpec> SecurityActionRequestMinimum;
+ public readonly PredefinedMember<FieldSpec> StringEmpty;
+ public readonly PredefinedMember<MethodSpec> StringEqual;
+ public readonly PredefinedMember<MethodSpec> StringInequal;
+ public readonly PredefinedMember<MethodSpec> StructLayoutAttributeCtor;
+ public readonly PredefinedMember<FieldSpec> StructLayoutCharSet;
+ public readonly PredefinedMember<FieldSpec> StructLayoutSize;
+ public readonly PredefinedMember<MethodSpec> TypeGetTypeFromHandle;
+
+ public PredefinedMembers (ModuleContainer module)
+ {
+ var types = module.PredefinedTypes;
+ var atypes = module.PredefinedAttributes;
+ var btypes = module.Compiler.BuiltinTypes;
+
+ ActivatorCreateInstance = new PredefinedMember<MethodSpec> (module, types.Activator,
+ MemberFilter.Method ("CreateInstance", 1, ParametersCompiled.EmptyReadOnlyParameters, null));
+
+ AsyncTaskMethodBuilderCreate = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilder,
+ MemberFilter.Method ("Create", 0, ParametersCompiled.EmptyReadOnlyParameters, types.AsyncTaskMethodBuilder.TypeSpec));
+
+ AsyncTaskMethodBuilderSetResult = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilder,
+ MemberFilter.Method ("SetResult", 0, ParametersCompiled.EmptyReadOnlyParameters, btypes.Void));
+
+ AsyncTaskMethodBuilderSetException = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilder,
+ MemberFilter.Method ("SetException", 0,
+ ParametersCompiled.CreateFullyResolved (btypes.Exception), btypes.Void));
+
+ AsyncTaskMethodBuilderTask = new PredefinedMember<PropertySpec> (module, types.AsyncTaskMethodBuilder,
+ MemberFilter.Property ("Task", null));
+
+ AsyncTaskMethodBuilderGenericCreate = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilderGeneric,
+ MemberFilter.Method ("Create", 0, ParametersCompiled.EmptyReadOnlyParameters, types.AsyncVoidMethodBuilder.TypeSpec));
+
+ AsyncTaskMethodBuilderGenericSetResult = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilderGeneric,
+ "SetResult", MemberKind.Method, () => new TypeSpec[] {
+ types.AsyncTaskMethodBuilderGeneric.TypeSpec.MemberDefinition.TypeParameters[0]
+ });
+
+ AsyncTaskMethodBuilderGenericSetException = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilderGeneric,
+ MemberFilter.Method ("SetException", 0,
+ ParametersCompiled.CreateFullyResolved (btypes.Exception), btypes.Void));
+
+ AsyncTaskMethodBuilderGenericTask = new PredefinedMember<PropertySpec> (module, types.AsyncTaskMethodBuilderGeneric,
+ MemberFilter.Property ("Task", null));
+
+ AsyncVoidMethodBuilderCreate = new PredefinedMember<MethodSpec> (module, types.AsyncVoidMethodBuilder,
+ MemberFilter.Method ("Create", 0, ParametersCompiled.EmptyReadOnlyParameters, types.AsyncVoidMethodBuilder.TypeSpec));
+
+ AsyncVoidMethodBuilderSetException = new PredefinedMember<MethodSpec> (module, types.AsyncVoidMethodBuilder,
+ MemberFilter.Method ("SetException", 0, null, btypes.Void));
+
+ AsyncVoidMethodBuilderSetResult = new PredefinedMember<MethodSpec> (module, types.AsyncVoidMethodBuilder,
+ MemberFilter.Method ("SetResult", 0, ParametersCompiled.EmptyReadOnlyParameters, btypes.Void));
+
+ DecimalCtor = new PredefinedMember<MethodSpec> (module, btypes.Decimal,
+ MemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (
+ btypes.Int, btypes.Int, btypes.Int, btypes.Bool, btypes.Byte)));
+
+ DecimalCtorInt = new PredefinedMember<MethodSpec> (module, btypes.Decimal,
+ MemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (btypes.Int)));
+
+ DecimalCtorLong = new PredefinedMember<MethodSpec> (module, btypes.Decimal,
+ MemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (btypes.Long)));
+
+ DecimalConstantAttributeCtor = new PredefinedMember<MethodSpec> (module, atypes.DecimalConstant,
+ MemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (
+ btypes.Byte, btypes.Byte, btypes.UInt, btypes.UInt, btypes.UInt)));
+
+ DefaultMemberAttributeCtor = new PredefinedMember<MethodSpec> (module, atypes.DefaultMember,
+ MemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (btypes.String)));
+
+ DelegateCombine = new PredefinedMember<MethodSpec> (module, btypes.Delegate, "Combine", btypes.Delegate, btypes.Delegate);
+ DelegateRemove = new PredefinedMember<MethodSpec> (module, btypes.Delegate, "Remove", btypes.Delegate, btypes.Delegate);
+
+ DelegateEqual = new PredefinedMember<MethodSpec> (module, btypes.Delegate,
+ new MemberFilter (Operator.GetMetadataName (Operator.OpType.Equality), 0, MemberKind.Operator, null, btypes.Bool));
+
+ DelegateInequal = new PredefinedMember<MethodSpec> (module, btypes.Delegate,
+ new MemberFilter (Operator.GetMetadataName (Operator.OpType.Inequality), 0, MemberKind.Operator, null, btypes.Bool));
+
+ DynamicAttributeCtor = new PredefinedMember<MethodSpec> (module, atypes.Dynamic,
+ MemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (
+ ArrayContainer.MakeType (module, btypes.Bool))));
+
+ FieldInfoGetFieldFromHandle = new PredefinedMember<MethodSpec> (module, types.FieldInfo,
+ "GetFieldFromHandle", MemberKind.Method, types.RuntimeFieldHandle);
+
+ FieldInfoGetFieldFromHandle2 = new PredefinedMember<MethodSpec> (module, types.FieldInfo,
+ "GetFieldFromHandle", MemberKind.Method, types.RuntimeFieldHandle, new PredefinedType (btypes.RuntimeTypeHandle));
+
+ FixedBufferAttributeCtor = new PredefinedMember<MethodSpec> (module, atypes.FixedBuffer,
+ MemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (btypes.Type, btypes.Int)));
+
+ IDisposableDispose = new PredefinedMember<MethodSpec> (module, btypes.IDisposable, "Dispose", TypeSpec.EmptyTypes);