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;
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 {
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;
//
// 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<string, TypeInfo> ();
field_hash = new Dictionary<string, int> (fields.Count);
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);
return null;
}
- public static StructInfo GetStructInfo (TypeSpec type)
+ public static StructInfo GetStructInfo (TypeSpec type, IMemberContext context)
{
if (type.BuiltinType > 0)
return null;
if (field_type_hash.TryGetValue (type, out info))
return info;
- return new StructInfo (type);
+ return new StructInfo (type, context);
}
}
}
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;
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
};
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);