[xbuild] Add new reserved properties $(MSBuildThisFile*).
[mono.git] / mcs / mcs / flowanalysis.cs
index 93c0c3ebb1b4bcf707e071afd7650c84f86516a0..07c9233b182afe71198234083607903469fa7790 100644 (file)
@@ -12,9 +12,6 @@
 using System;
 using System.Text;
 using System.Collections.Generic;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Diagnostics;
 
 namespace Mono.CSharp
 {
@@ -1069,17 +1066,6 @@ namespace Mono.CSharp
                        return info;
                }
 
-               public static TypeInfo GetTypeInfo (TypeContainer tc)
-               {
-                       TypeInfo info;
-                       if (type_hash.TryGetValue (tc.Definition, out info))
-                               return info;
-
-                       info = new TypeInfo (tc);
-                       type_hash.Add (tc.Definition, info);
-                       return info;
-               }
-
                private TypeInfo (TypeSpec type)
                {
                        this.Type = type;
@@ -1097,23 +1083,6 @@ namespace Mono.CSharp
                        }
                }
 
-               private TypeInfo (TypeContainer tc)
-               {
-                       this.Type = tc.Definition;
-
-                       struct_info = StructInfo.GetStructInfo (tc);
-                       if (struct_info != null) {
-                               Length = struct_info.Length;
-                               TotalLength = struct_info.TotalLength;
-                               SubStructInfo = struct_info.StructFields;
-                               IsStruct = true;
-                       } else {
-                               Length = 0;
-                               TotalLength = 1;
-                               IsStruct = false;
-                       }
-               }
-
                TypeInfo (StructInfo struct_info, int offset)
                {
                        this.struct_info = struct_info;
@@ -1158,7 +1127,7 @@ namespace Mono.CSharp
                                if (!branching.IsFieldAssigned (vi, field.Name)) {
                                        if (field.MemberDefinition is Property.BackingField) {
                                                ec.Report.Error (843, loc,
-                                                       "An automatically implemented property `{0}' must be fully assigned before control leaves the constructor. Consider calling default contructor",
+                                                       "An automatically implemented property `{0}' must be fully assigned before control leaves the constructor. Consider calling the default struct contructor from a constructor initializer",
                                                        field.GetSignatureForError ());
                                        } else {
                                                ec.Report.Error (171, loc,
@@ -1291,11 +1260,7 @@ namespace Mono.CSharp
 
                        public static StructInfo GetStructInfo (TypeSpec type)
                        {
-                               if (!TypeManager.IsValueType (type) || TypeManager.IsEnumType (type) ||
-                                   TypeManager.IsBuiltinType (type))
-                                       return null;
-
-                               if (TypeManager.IsGenericParameter (type))
+                               if (!type.IsStruct || TypeManager.IsBuiltinType (type))
                                        return null;
 
                                StructInfo info;
@@ -1304,15 +1269,6 @@ namespace Mono.CSharp
 
                                return new StructInfo (type);
                        }
-
-                       public static StructInfo GetStructInfo (TypeContainer tc)
-                       {
-                               StructInfo info;
-                               if (field_type_hash.TryGetValue (tc.Definition, out info))
-                                       return info;
-
-                               return new StructInfo (tc.Definition);
-                       }
                }
        }
 
@@ -1407,7 +1363,7 @@ namespace Mono.CSharp
                public bool IsAssigned (ResolveContext ec)
                {
                        return !ec.DoFlowAnalysis ||
-                               ec.OmitStructFlowAnalysis && TypeInfo.IsStruct ||
+                               (ec.OmitStructFlowAnalysis && TypeInfo.Type.IsStruct) ||
                                ec.CurrentBranching.IsAssigned (this);
                }