X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fmcs%2Fflowanalysis.cs;h=da30a3e5b907570cd2453f3c40761e43935c5f29;hb=19a22ede0d65d0615a57075ca097220a1d50f514;hp=dbb74a7515a0d930a37c4832521afe6acb04c247;hpb=f0d2ee46f839cc3cebcdaa674b3a31d9a3e22863;p=mono.git diff --git a/mcs/mcs/flowanalysis.cs b/mcs/mcs/flowanalysis.cs index dbb74a7515a..da30a3e5b90 100644 --- a/mcs/mcs/flowanalysis.cs +++ b/mcs/mcs/flowanalysis.cs @@ -105,7 +105,7 @@ namespace Mono.CSharp return struct_info.GetStructField (name); } - public static TypeInfo GetTypeInfo (TypeSpec type) + public static TypeInfo GetTypeInfo (TypeSpec type, IMemberContext context) { if (!type.IsStruct) return simple_type; @@ -114,7 +114,7 @@ namespace Mono.CSharp if (type_hash.TryGetValue (type, out info)) return info; - var struct_info = StructInfo.GetStructInfo (type); + var struct_info = StructInfo.GetStructInfo (type, context); if (struct_info != null) { info = new TypeInfo (struct_info, 0); } else { @@ -139,7 +139,7 @@ namespace Mono.CSharp var field = struct_info.Fields[i]; if (!fc.IsStructFieldDefinitelyAssigned (vi, field.Name)) { - var bf = field.MemberDefinition as Property.BackingField; + var bf = field.MemberDefinition as Property.BackingFieldDeclaration; if (bf != null) { if (bf.Initializer != null) continue; @@ -184,11 +184,11 @@ namespace Mono.CSharp // // We only need one instance per type // - StructInfo (TypeSpec type) + StructInfo (TypeSpec type, IMemberContext context) { field_type_hash.Add (type, this); - fields = MemberCache.GetAllFieldsForDefiniteAssignment (type); + fields = MemberCache.GetAllFieldsForDefiniteAssignment (type, context); struct_field_hash = new Dictionary (); field_hash = new Dictionary (fields.Count); @@ -202,7 +202,7 @@ namespace Mono.CSharp var field = fields [i]; if (field.MemberType.IsStruct) - sinfo [i] = GetStructInfo (field.MemberType); + sinfo [i] = GetStructInfo (field.MemberType, context); if (sinfo [i] == null) field_hash.Add (field.Name, ++Length); @@ -260,7 +260,7 @@ namespace Mono.CSharp return null; } - public static StructInfo GetStructInfo (TypeSpec type) + public static StructInfo GetStructInfo (TypeSpec type, IMemberContext context) { if (type.BuiltinType > 0) return null; @@ -269,7 +269,7 @@ namespace Mono.CSharp if (field_type_hash.TryGetValue (type, out info)) return info; - return new StructInfo (type); + return new StructInfo (type, context); } } } @@ -305,11 +305,11 @@ namespace Mono.CSharp VariableInfo[] sub_info; - VariableInfo (string name, TypeSpec type, int offset) + VariableInfo (string name, TypeSpec type, int offset, IMemberContext context) { this.Name = name; this.Offset = offset; - this.TypeInfo = TypeInfo.GetTypeInfo (type); + this.TypeInfo = TypeInfo.GetTypeInfo (type, context); Length = TypeInfo.TotalLength; @@ -343,14 +343,14 @@ namespace Mono.CSharp public static VariableInfo Create (BlockContext bc, LocalVariable variable) { - var info = new VariableInfo (variable.Name, variable.Type, bc.AssignmentInfoOffset); + var info = new VariableInfo (variable.Name, variable.Type, bc.AssignmentInfoOffset, bc); bc.AssignmentInfoOffset += info.Length; return info; } public static VariableInfo Create (BlockContext bc, Parameter parameter) { - var info = new VariableInfo (parameter.Name, parameter.Type, bc.AssignmentInfoOffset) { + var info = new VariableInfo (parameter.Name, parameter.Type, bc.AssignmentInfoOffset, bc) { IsParameter = true }; @@ -669,7 +669,7 @@ namespace Mono.CSharp large_bits[index >> 5] |= (1 << (index & 31)); } - static bool AreEqual (DefiniteAssignmentBitSet a, DefiniteAssignmentBitSet b) + public static bool AreEqual (DefiniteAssignmentBitSet a, DefiniteAssignmentBitSet b) { if (a.large_bits == null) return (a.bits & ~copy_on_write_flag) == (b.bits & ~copy_on_write_flag);