public void Emit(OpCode opcode, FieldSpec field) { if (IsAnonymousStoreyMutateRequired) { field = field.Mutate(CurrentAnonymousMethod.Storey.Mutator); } ig.Emit(opcode, field.GetMetaInfo()); if (TrackStackTypes) { switch (opcode.StackBehaviourPush) { case StackBehaviour.Push0: // nothing break; case StackBehaviour.Push1: SetStackType(field.MemberType); break; case StackBehaviour.Pushi: SetStackType(ReferenceContainer.MakeType(Module, field.MemberType)); break; default: throw new NotImplementedException(); } } }
static public void Reset() { // object_type = null; // TODO: I am really bored by all this static stuff system_type_get_type_from_handle = bool_movenext_void = void_dispose_void = void_monitor_enter_object = void_monitor_exit_object = void_initializearray_array_fieldhandle = int_interlocked_compare_exchange = gen_interlocked_compare_exchange = methodbase_get_type_from_handle = methodbase_get_type_from_handle_generic = fieldinfo_get_field_from_handle = fieldinfo_get_field_from_handle_generic = activator_create_instance = delegate_combine_delegate_delegate = delegate_remove_delegate_delegate = null; int_get_offset_to_string_data = ienumerator_getcurrent = null; void_decimal_ctor_five_args = void_decimal_ctor_int_arg = void_decimal_ctor_long_arg = null; string_empty = null; typed_reference_type = arg_iterator_type = mbr_type = generic_ilist_type = generic_icollection_type = generic_ienumerator_type = generic_ienumerable_type = generic_nullable_type = expression_type = null; }
public override bool Define() { if (!base.Define()) { return(false); } // SYNC_MOD_CTRL if ((ModFlags & Modifiers.SYNC) == Modifiers.SYNC) { Report.Error(3661, Location, "A sync modifier cannot be used in field declaration. "); } MetaType[] required_modifier = null; if ((ModFlags & Modifiers.VOLATILE) != 0) { var mod = Module.PredefinedTypes.IsVolatile.Resolve(); if (mod != null) { required_modifier = new MetaType[] { mod.GetMetaInfo() } } ; } FieldBuilder = Parent.TypeBuilder.DefineField( Name, member_type.GetMetaInfo(), required_modifier, null, ModifiersExtensions.FieldAttr(ModFlags)); spec = new FieldSpec(Parent.Definition, this, MemberType, FieldBuilder, ModFlags); // // Don't cache inaccessible fields except for struct where we // need them for definitive assignment checks // if ((ModFlags & Modifiers.BACKING_FIELD) == 0 || Parent.Kind == MemberKind.Struct) { Parent.MemberCache.AddMember(spec); } if (initializer != null) { Parent.RegisterFieldForInitialization(this, new FieldInitializer(this, initializer, TypeExpression.Location)); } if (declarators != null) { foreach (var d in declarators) { var f = new Field(Parent, d.GetFieldTypeExpression(this), ModFlags, new MemberName(d.Name.Value, d.Name.Location), OptAttributes); if (d.Initializer != null) { f.initializer = d.Initializer; } f.Define(); Parent.PartialContainer.Members.Add(f); } } return(true); }
public FixedFieldSpec(TypeSpec declaringType, IMemberDefinition definition, FieldInfo info, FieldSpec element, Modifiers modifiers) : base(declaringType, definition, element.MemberType, info, modifiers) { this.element = element; // It's never CLS-Compliant state &= ~StateFlags.CLSCompliant_Undetected; }
public override bool Define() { if (!base.Define()) { return(false); } MetaType[] required_modifier = null; if ((ModFlags & Modifiers.VOLATILE) != 0) { var mod = Module.PredefinedTypes.IsVolatile.Resolve(); if (mod != null) { required_modifier = new MetaType[] { mod.GetMetaInfo() } } ; } FieldBuilder = Parent.TypeBuilder.DefineField( Name, member_type.GetMetaInfo(), required_modifier, null, ModifiersExtensions.FieldAttr(ModFlags)); spec = new FieldSpec(Parent.Definition, this, MemberType, FieldBuilder, ModFlags); // // Don't cache inaccessible fields except for struct where we // need them for definitive assignment checks // if ((ModFlags & Modifiers.BACKING_FIELD) == 0 || Parent.Kind == MemberKind.Struct) { Parent.MemberCache.AddMember(spec); } if (initializer != null) { ((TypeContainer)Parent).RegisterFieldForInitialization(this, new FieldInitializer(spec, initializer, this)); } if (declarators != null) { var t = new TypeExpression(MemberType, TypeExpression.Location); int index = Parent.PartialContainer.Fields.IndexOf(this); foreach (var d in declarators) { var f = new Field(Parent, t, ModFlags, new MemberName(d.Name.Value, d.Name.Location), OptAttributes); if (d.Initializer != null) { f.initializer = d.Initializer; } Parent.PartialContainer.Fields.Insert(++index, f); } } return(true); }
public void Emit(OpCode opcode, FieldSpec field) { if (IsAnonymousStoreyMutateRequired) { field = field.Mutate(CurrentAnonymousMethod.Storey.Mutator); } ig.Emit(opcode, field.GetMetaInfo()); }
public FieldInitializer(FieldSpec spec, Expression expression, IMemberContext mc) : base(new FieldExpr(spec, expression.Location), expression, expression.Location) { this.mc = mc; if (!spec.IsStatic) { ((FieldExpr)target).InstanceExpression = new CompilerGeneratedThis(mc.CurrentType, expression.Location); } }
public override bool Define() { if (!base.Define()) { return(false); } MetaType[] required_modifier = null; if ((ModFlags & Modifiers.VOLATILE) != 0) { var mod = Module.PredefinedTypes.IsVolatile.Resolve(); if (mod != null) { required_modifier = new MetaType[] { mod.GetMetaInfo() } } ; } FieldBuilder = Parent.TypeBuilder.DefineField( Name, member_type.GetMetaInfo(), required_modifier, null, ModifiersExtensions.FieldAttr(ModFlags)); spec = new FieldSpec(Parent.Definition, this, MemberType, FieldBuilder, ModFlags); // Don't cache inaccessible fields if ((ModFlags & Modifiers.BACKING_FIELD) == 0) { Parent.MemberCache.AddMember(spec); } if (initializer != null) { ((TypeContainer)Parent).RegisterFieldForInitialization(this, new FieldInitializer(spec, initializer, this)); } if (declarators != null) { var t = new TypeExpression(MemberType, TypeExpression.Location); int index = Parent.PartialContainer.Fields.IndexOf(this); foreach (var d in declarators) { var f = new Field(Parent, t, ModFlags, new MemberName(d.Name.Value, d.Name.Location), OptAttributes); if (d.Initializer != null) { f.initializer = d.Initializer; } Parent.PartialContainer.Fields.Insert(++index, f); } } /* * if ((ModFlags & (Modifiers.STATIC | Modifiers.READONLY | Modifiers.COMPILER_GENERATED)) == Modifiers.STATIC) * Console.WriteLine ("{0}: {1}", Location.ToString (), GetSignatureForError ()); */ return(true); }
public override bool Define() { if (!base.Define()) { return(false); } if (!BuiltinTypeSpec.IsPrimitiveType(MemberType)) { Report.Error(1663, Location, "`{0}': Fixed size buffers type must be one of the following: bool, byte, short, int, long, char, sbyte, ushort, uint, ulong, float or double", GetSignatureForError()); } else if (declarators != null) { var t = new TypeExpression(MemberType, TypeExpression.Location); int index = Parent.PartialContainer.Fields.IndexOf(this); foreach (var d in declarators) { var f = new FixedField(Parent, t, ModFlags, new MemberName(d.Name.Value, d.Name.Location), OptAttributes); f.initializer = d.Initializer; ((ConstInitializer)f.initializer).Name = d.Name.Value; Parent.PartialContainer.Fields.Insert(++index, f); } } // Create nested fixed buffer container string name = String.Format("<{0}>__FixedBuffer{1}", Name, GlobalCounter++); fixed_buffer_type = Parent.TypeBuilder.DefineNestedType(name, TypeAttributes.NestedPublic | TypeAttributes.Sealed | TypeAttributes.BeforeFieldInit, Compiler.BuiltinTypes.ValueType.GetMetaInfo()); var ffield = fixed_buffer_type.DefineField(FixedElementName, MemberType.GetMetaInfo(), FieldAttributes.Public); FieldBuilder = Parent.TypeBuilder.DefineField(Name, fixed_buffer_type, ModifiersExtensions.FieldAttr(ModFlags)); var element_spec = new FieldSpec(null, this, MemberType, ffield, ModFlags); spec = new FixedFieldSpec(Parent.Definition, this, FieldBuilder, element_spec, ModFlags); Parent.MemberCache.AddMember(spec); return(true); }
public override bool Define() { if (!base.Define ()) return false; try { Type[] required_modifier = null; if ((ModFlags & Modifiers.VOLATILE) != 0) { if (TypeManager.isvolatile_type == null) TypeManager.isvolatile_type = TypeManager.CoreLookupType (Compiler, "System.Runtime.CompilerServices", "IsVolatile", MemberKind.Class, true); if (TypeManager.isvolatile_type != null) required_modifier = new Type[] { TypeManager.isvolatile_type.GetMetaInfo () }; } FieldBuilder = Parent.TypeBuilder.DefineField ( Name, member_type.GetMetaInfo (), required_modifier, null, ModifiersExtensions.FieldAttr (ModFlags)); spec = new FieldSpec (Parent.Definition, this, MemberType, FieldBuilder, ModFlags); // Don't cache inaccessible fields if ((ModFlags & Modifiers.BACKING_FIELD) == 0) { Parent.MemberCache.AddMember (spec); } } catch (ArgumentException) { Report.RuntimeMissingSupport (Location, "`void' or `void*' field type"); return false; } if (initializer != null) { ((TypeContainer) Parent).RegisterFieldForInitialization (this, new FieldInitializer (this, initializer, this)); } return true; }
public FieldSpec DefineInitializedData(byte[] data, Location loc) { Struct size_type; if (!size_types.TryGetValue(data.Length, out size_type)) { // // Build common type for this data length. We cannot use // DefineInitializedData because it creates public type, // and its name is not unique among modules // size_type = new Struct(this, new MemberName("$ArrayType=" + data.Length, loc), Modifiers.PRIVATE | Modifiers.COMPILER_GENERATED, null); size_type.CreateContainer(); size_type.DefineContainer(); size_types.Add(data.Length, size_type); // It has to work even if StructLayoutAttribute does not exist size_type.TypeBuilder.__SetLayout(1, data.Length); } FieldSpec fs; var data_hash = GenerateDataFieldName(data); if (!data_hashes.TryGetValue(data_hash, out fs)) { var name = "$field-" + data_hash; const Modifiers fmod = Modifiers.STATIC | Modifiers.INTERNAL | Modifiers.READONLY; var fbuilder = TypeBuilder.DefineField(name, size_type.CurrentType.GetMetaInfo(), ModifiersExtensions.FieldAttr(fmod) | FieldAttributes.HasFieldRVA); fbuilder.__SetDataAndRVA(data); fs = new FieldSpec(CurrentType, null, size_type.CurrentType, fbuilder, fmod); data_hashes.Add(data_hash, fs); } return(fs); }
public override bool Define () { if (!base.Define ()) return false; MetaType[] required_modifier = null; if ((ModFlags & Modifiers.VOLATILE) != 0) { var mod = Module.PredefinedTypes.IsVolatile.Resolve (); if (mod != null) required_modifier = new MetaType[] { mod.GetMetaInfo () }; } FieldBuilder = Parent.TypeBuilder.DefineField ( Name, member_type.GetMetaInfo (), required_modifier, null, ModifiersExtensions.FieldAttr (ModFlags)); spec = new FieldSpec (Parent.Definition, this, MemberType, FieldBuilder, ModFlags); // // Don't cache inaccessible fields except for struct where we // need them for definitive assignment checks // if ((ModFlags & Modifiers.BACKING_FIELD) == 0 || Parent.Kind == MemberKind.Struct) { Parent.MemberCache.AddMember (spec); } if (initializer != null) { ((TypeContainer) Parent).RegisterFieldForInitialization (this, new FieldInitializer (spec, initializer, this)); } if (declarators != null) { var t = new TypeExpression (MemberType, TypeExpression.Location); int index = Parent.PartialContainer.Fields.IndexOf (this); foreach (var d in declarators) { var f = new Field (Parent, t, ModFlags, new MemberName (d.Name.Value, d.Name.Location), OptAttributes); if (d.Initializer != null) f.initializer = d.Initializer; Parent.PartialContainer.Fields.Insert (++index, f); } } return true; }
public void Emit (OpCode opcode, FieldSpec field) { if (IsAnonymousStoreyMutateRequired) field = field.Mutate (CurrentAnonymousMethod.Storey.Mutator); ig.Emit (opcode, field.GetMetaInfo ()); if (TrackStackTypes) { switch (opcode.StackBehaviourPush) { case StackBehaviour.Push0: // nothing break; case StackBehaviour.Push1: SetStackType (field.MemberType); break; case StackBehaviour.Pushi: SetStackType (ReferenceContainer.MakeType (Module, field.MemberType)); break; default: throw new NotImplementedException (); } } }
public override bool Define () { if (!base.Define ()) return false; if (!BuiltinTypeSpec.IsPrimitiveType (MemberType)) { Report.Error (1663, Location, "`{0}': Fixed size buffers type must be one of the following: bool, byte, short, int, long, char, sbyte, ushort, uint, ulong, float or double", GetSignatureForError ()); } else if (declarators != null) { var t = new TypeExpression (MemberType, TypeExpression.Location); int index = Parent.PartialContainer.Fields.IndexOf (this); foreach (var d in declarators) { var f = new FixedField (Parent, t, ModFlags, new MemberName (d.Name.Value, d.Name.Location), OptAttributes); f.initializer = d.Initializer; ((ConstInitializer) f.initializer).Name = d.Name.Value; Parent.PartialContainer.Fields.Insert (++index, f); } } // Create nested fixed buffer container string name = String.Format ("<{0}>__FixedBuffer{1}", Name, GlobalCounter++); fixed_buffer_type = Parent.TypeBuilder.DefineNestedType (name, TypeAttributes.NestedPublic | TypeAttributes.Sealed | TypeAttributes.BeforeFieldInit, Compiler.BuiltinTypes.ValueType.GetMetaInfo ()); var ffield = fixed_buffer_type.DefineField (FixedElementName, MemberType.GetMetaInfo (), FieldAttributes.Public); FieldBuilder = Parent.TypeBuilder.DefineField (Name, fixed_buffer_type, ModifiersExtensions.FieldAttr (ModFlags)); var element_spec = new FieldSpec (null, this, MemberType, ffield, ModFlags); spec = new FixedFieldSpec (Parent.Definition, this, FieldBuilder, element_spec, ModFlags); Parent.MemberCache.AddMember (spec); return true; }
public FixedFieldSpec (TypeSpec declaringType, IMemberDefinition definition, FieldInfo info, FieldSpec element, Modifiers modifiers) : base (declaringType, definition, element.MemberType, info, modifiers) { this.element = element; // It's never CLS-Compliant state &= ~StateFlags.CLSCompliant_Undetected; }
public FieldInitializer (FieldSpec spec, Expression expression, IMemberContext mc) : base (new FieldExpr (spec, expression.Location), expression, expression.Location) { this.mc = mc; if (!spec.IsStatic) ((FieldExpr)target).InstanceExpression = CompilerGeneratedThis.Instance; }
public void Emit (OpCode opcode, FieldSpec field) { if (IsAnonymousStoreyMutateRequired) field = field.Mutate (CurrentAnonymousMethod.Storey.Mutator); ig.Emit (opcode, field.GetMetaInfo ()); }
static public void Reset () { // object_type = null; assembly_internals_vis_attrs = new Dictionary<Assembly, bool> (); // TODO: I am really bored by all this static stuff system_type_get_type_from_handle = bool_movenext_void = void_dispose_void = void_monitor_enter_object = void_monitor_exit_object = void_initializearray_array_fieldhandle = int_interlocked_compare_exchange = methodbase_get_type_from_handle = methodbase_get_type_from_handle_generic = fieldinfo_get_field_from_handle = fieldinfo_get_field_from_handle_generic = activator_create_instance = delegate_combine_delegate_delegate = delegate_remove_delegate_delegate = null; int_get_offset_to_string_data = ienumerator_getcurrent = null; void_decimal_ctor_five_args = void_decimal_ctor_int_arg = void_decimal_ctor_long_arg = null; string_empty = null; call_site_type = generic_call_site_type = binder_flags = null; binder_type = null; typed_reference_type = arg_iterator_type = mbr_type = runtime_helpers_type = iasyncresult_type = asynccallback_type = runtime_argument_handle_type = void_ptr_type = isvolatile_type = generic_ilist_type = generic_icollection_type = generic_ienumerator_type = generic_ienumerable_type = generic_nullable_type = expression_type = parameter_expression_type = fieldinfo_type = methodinfo_type = ctorinfo_type = null; expression_type_expr = null; }
static public void Reset () { // object_type = null; // TODO: I am really bored by all this static stuff system_type_get_type_from_handle = bool_movenext_void = void_dispose_void = void_monitor_enter_object = void_monitor_exit_object = void_initializearray_array_fieldhandle = int_interlocked_compare_exchange = gen_interlocked_compare_exchange = methodbase_get_type_from_handle = methodbase_get_type_from_handle_generic = fieldinfo_get_field_from_handle = fieldinfo_get_field_from_handle_generic = activator_create_instance = delegate_combine_delegate_delegate = delegate_remove_delegate_delegate = null; int_get_offset_to_string_data = ienumerator_getcurrent = null; void_decimal_ctor_five_args = void_decimal_ctor_int_arg = void_decimal_ctor_long_arg = null; string_empty = null; typed_reference_type = arg_iterator_type = mbr_type = generic_ilist_type = generic_icollection_type = generic_ienumerator_type = generic_ienumerable_type = generic_nullable_type = expression_type = null; }
public FieldInfo Mutate (FieldSpec fs) { // TODO: return fs.GetMetaInfo (); }
public override bool Define() { if (!base.Define ()) return false; if (!TypeManager.IsPrimitiveType (MemberType)) { Report.Error (1663, Location, "`{0}': Fixed size buffers type must be one of the following: bool, byte, short, int, long, char, sbyte, ushort, uint, ulong, float or double", GetSignatureForError ()); } // Create nested fixed buffer container string name = String.Format ("<{0}>__FixedBuffer{1}", Name, GlobalCounter++); fixed_buffer_type = Parent.TypeBuilder.DefineNestedType (name, Parent.Module.DefaultCharSetType | TypeAttributes.NestedPublic | TypeAttributes.Sealed | TypeAttributes.BeforeFieldInit, TypeManager.value_type.GetMetaInfo ()); fixed_buffer_type.DefineField (FixedElementName, MemberType.GetMetaInfo (), FieldAttributes.Public); RootContext.RegisterCompilerGeneratedType (fixed_buffer_type); FieldBuilder = Parent.TypeBuilder.DefineField (Name, fixed_buffer_type, ModifiersExtensions.FieldAttr (ModFlags)); var element_spec = new FieldSpec (null, this, MemberType, FieldBuilder, ModFlags); spec = new FixedFieldSpec (Parent.Definition, this, FieldBuilder, element_spec, ModFlags); Parent.MemberCache.AddMember (spec); return true; }
// // Fabricates stack forwarder based on stack types which copies all // parameters to type fields // public MethodSpec GetStackForwarder(TypeSpec[] types, out FieldSpec[] fields) { if (stack_forwarders == null) { stack_forwarders = new Dictionary <TypeSpec[], Tuple <MethodSpec, FieldSpec[]> > (TypeSpecComparer.Default); } else { // // Does same forwarder method with same types already exist // Tuple <MethodSpec, FieldSpec[]> method; if (stack_forwarders.TryGetValue(types, out method)) { fields = method.Item2; return(method.Item1); } } Parameter[] p = new Parameter[types.Length + 1]; TypeSpec[] ptypes = new TypeSpec[p.Length]; fields = new FieldSpec[types.Length]; for (int i = 0; i < types.Length; ++i) { var t = types[i]; TypeSpec parameter_type = t; if (parameter_type == InternalType.CurrentTypeOnStack) { parameter_type = CurrentType; } p[i] = new Parameter(new TypeExpression(parameter_type, Location), null, 0, null, Location); ptypes[i] = parameter_type; if (t == InternalType.CurrentTypeOnStack) { // Null means the type is `this' we can optimize by ignoring continue; } var reference = t as ReferenceContainer; if (reference != null) { t = reference.Element; } fields[i] = CreateStackValueField(t); } var this_parameter = new Parameter(new TypeExpression(CurrentType, Location), null, 0, null, Location); p[types.Length] = this_parameter; ptypes[types.Length] = CurrentType; var parameters = ParametersCompiled.CreateFullyResolved(p, ptypes); var m = new Method(this, null, new TypeExpression(Compiler.BuiltinTypes.Void, Location), Modifiers.STATIC | Modifiers.PRIVATE | Modifiers.COMPILER_GENERATED | Modifiers.DEBUGGER_HIDDEN, new MemberName("<>s__" + stack_forwarders.Count.ToString("X")), parameters, null); m.Block = new ToplevelBlock(Compiler, parameters, Location); m.Block.AddScopeStatement(new ParametersLoadStatement(fields, ptypes)); m.Define(); Methods.Add(m); stack_forwarders.Add(types, Tuple.Create(m.Spec, fields)); return(m.Spec); }
public override bool Define () { if (!base.Define ()) return false; MetaType[] required_modifier = null; if ((ModFlags & Modifiers.VOLATILE) != 0) { var mod = Module.PredefinedTypes.IsVolatile.Resolve (); if (mod != null) required_modifier = new MetaType[] { mod.GetMetaInfo () }; } FieldBuilder = Parent.TypeBuilder.DefineField ( Name, member_type.GetMetaInfo (), required_modifier, null, ModifiersExtensions.FieldAttr (ModFlags)); spec = new FieldSpec (Parent.Definition, this, MemberType, FieldBuilder, ModFlags); // Don't cache inaccessible fields if ((ModFlags & Modifiers.BACKING_FIELD) == 0) { Parent.MemberCache.AddMember (spec); } if (initializer != null) { ((TypeContainer) Parent).RegisterFieldForInitialization (this, new FieldInitializer (spec, initializer, this)); } if (declarators != null) { var t = new TypeExpression (MemberType, TypeExpression.Location); int index = Parent.PartialContainer.Fields.IndexOf (this); foreach (var d in declarators) { var f = new Field (Parent, t, ModFlags, new MemberName (d.Name.Value, d.Name.Location), OptAttributes); if (d.Initializer != null) f.initializer = d.Initializer; Parent.PartialContainer.Fields.Insert (++index, f); } } /* if ((ModFlags & (Modifiers.STATIC | Modifiers.READONLY | Modifiers.COMPILER_GENERATED)) == Modifiers.STATIC) Console.WriteLine ("{0}: {1}", Location.ToString (), GetSignatureForError ()); */ return true; }
public FieldSpec DefineInitializedData (byte[] data, Location loc) { Struct size_type; if (!size_types.TryGetValue (data.Length, out size_type)) { // // Build common type for this data length. We cannot use // DefineInitializedData because it creates public type, // and its name is not unique among modules // size_type = new Struct (this, new MemberName ("$ArrayType=" + data.Length, loc), Modifiers.PRIVATE | Modifiers.COMPILER_GENERATED, null); size_type.CreateContainer (); size_type.DefineContainer (); size_types.Add (data.Length, size_type); // It has to work even if StructLayoutAttribute does not exist size_type.TypeBuilder.__SetLayout (1, data.Length); } FieldSpec fs; var data_hash = GenerateDataFieldName (data); if (!data_hashes.TryGetValue (data_hash, out fs)) { var name = "$field-" + data_hash; const Modifiers fmod = Modifiers.STATIC | Modifiers.INTERNAL | Modifiers.READONLY; var fbuilder = TypeBuilder.DefineField (name, size_type.CurrentType.GetMetaInfo (), ModifiersExtensions.FieldAttr (fmod) | FieldAttributes.HasFieldRVA); fbuilder.__SetDataAndRVA (data); fs = new FieldSpec (CurrentType, null, size_type.CurrentType, fbuilder, fmod); data_hashes.Add (data_hash, fs); } return fs; }
public FieldExpr(FieldSpec spec, Location loc) { this.spec = spec; this.loc = loc; type = spec.MemberType; }
public override bool Define () { if (!base.Define ()) return false; Type[] required_modifier = null; if ((ModFlags & Modifiers.VOLATILE) != 0) { if (TypeManager.isvolatile_type == null) TypeManager.isvolatile_type = TypeManager.CoreLookupType (Compiler, "System.Runtime.CompilerServices", "IsVolatile", MemberKind.Class, true); if (TypeManager.isvolatile_type != null) required_modifier = new Type[] { TypeManager.isvolatile_type.GetMetaInfo () }; } FieldBuilder = Parent.TypeBuilder.DefineField ( Name, member_type.GetMetaInfo (), required_modifier, null, ModifiersExtensions.FieldAttr (ModFlags)); spec = new FieldSpec (Parent.Definition, this, MemberType, FieldBuilder, ModFlags); // Don't cache inaccessible fields if ((ModFlags & Modifiers.BACKING_FIELD) == 0) { Parent.MemberCache.AddMember (spec); } if (initializer != null) { ((TypeContainer) Parent).RegisterFieldForInitialization (this, new FieldInitializer (spec, initializer, this)); } if (declarators != null) { var t = new TypeExpression (MemberType, TypeExpression.Location); int index = Parent.PartialContainer.Fields.IndexOf (this); foreach (var d in declarators) { var f = new Field (Parent, t, ModFlags, new MemberName (d.Name.Value, d.Name.Location), OptAttributes); if (d.Initializer != null) f.initializer = d.Initializer; Parent.PartialContainer.Fields.Insert (++index, f); } } return true; }