public enum LanguageVersion
{
Default = 0,
- ISO_1 = 1
+ ISO_1 = 1,
+ LINQ
}
public class RootContext {
static TypeBuilder impl_details_class;
public static int WarningLevel;
-
+
public static Target Target;
public static string TargetExt;
impl_details_class = null;
helper_classes = null;
}
-
+
public static bool NeedsEntryPoint {
get { return RootContext.Target == Target.Exe || RootContext.Target == Target.WinExe; }
}
//
// Resolves a single class during the corlib bootstrap process
//
- static TypeBuilder BootstrapCorlib_ResolveClass (TypeContainer root, string name)
+ static Type BootstrapCorlib_ResolveClass (TypeContainer root, string name)
{
object o = root.GetDefinition (name);
if (o == null){
return null;
}
- return ((DeclSpace) o).DefineType ();
+ Type t = ((DeclSpace) o).DefineType ();
+ if (t != null)
+ AttributeTester.RegisterNonObsoleteType (t);
+ return t;
}
//
return;
}
- ((DeclSpace) o).DefineType ();
+ Type t = ((DeclSpace) o).DefineType ();
+ if (t != null)
+ AttributeTester.RegisterNonObsoleteType (t);
}
//
TypeManager.system_object_expr.Type = TypeManager.object_type;
TypeManager.value_type = BootstrapCorlib_ResolveClass (root, "System.ValueType");
TypeManager.system_valuetype_expr.Type = TypeManager.value_type;
+
+ //
+ // The core attributes
+ //
+ BootstrapCorlib_ResolveInterface (root, "System.Runtime.InteropServices._Attribute");
TypeManager.attribute_type = BootstrapCorlib_ResolveClass (root, "System.Attribute");
+ TypeManager.obsolete_attribute_type = BootstrapCorlib_ResolveClass (root, "System.ObsoleteAttribute");
TypeManager.indexer_name_type = BootstrapCorlib_ResolveClass (root, "System.Runtime.CompilerServices.IndexerNameAttribute");
string [] interfaces_first_stage = {
"System.Runtime.Serialization.ISerializable",
"System.Reflection.IReflect",
- "System.Reflection.ICustomAttributeProvider"
+ "System.Reflection.ICustomAttributeProvider",
+#if GMCS_SOURCE
+ "System.Runtime.InteropServices._Exception",
+
+ //
+ // Generic types
+ //
+ "System.Collections.Generic.IEnumerator`1",
+ "System.Collections.Generic.IEnumerable`1"
+#endif
};
foreach (string iname in interfaces_first_stage)
"System.Reflection.MemberInfo",
"System.Type",
"System.Exception",
+#if GMCS_SOURCE
+ "System.Activator",
+#endif
//
// These are not really important in the order, but they
"System.Runtime.InteropServices.DllImportAttribute",
"System.Runtime.CompilerServices.MethodImplAttribute",
"System.Runtime.InteropServices.MarshalAsAttribute",
+#if GMCS_SOURCE
+ "System.Runtime.CompilerServices.CompilerGeneratedAttribute",
+ "System.Runtime.CompilerServices.FixedBufferAttribute",
+#endif
"System.Diagnostics.ConditionalAttribute",
- "System.ObsoleteAttribute",
"System.ParamArrayAttribute",
"System.CLSCompliantAttribute",
"System.Security.UnverifiableCodeAttribute",
"System.Runtime.InteropServices.OutAttribute",
"System.Runtime.InteropServices.StructLayoutAttribute",
"System.Runtime.InteropServices.FieldOffsetAttribute",
+#if GMCS_SOURCE
+ "System.Runtime.InteropServices.DefaultCharSetAttribute",
+#endif
"System.InvalidOperationException",
"System.NotSupportedException",
"System.MarshalByRefObject",
foreach (string cname in classes_second_stage)
BootstrapCorlib_ResolveClass (root, cname);
-
+#if GMCS_SOURCE
+ BootstrapCorlib_ResolveStruct (root, "System.Nullable`1");
+#endif
BootstrapCorlib_ResolveDelegate (root, "System.AsyncCallback");
// These will be defined indirectly during the previous ResolveDelegate.
//
if (helper_classes != null){
foreach (TypeBuilder type_builder in helper_classes) {
-#if NET_2_0
+#if GMCS_SOURCE
type_builder.SetCustomAttribute (TypeManager.compiler_generated_attr);
#endif
type_builder.CreateType ();
// have been defined through `ResolveTree'
static public void PopulateTypes ()
{
+
if (type_container_resolve_order != null){
+#if GMCS_SOURCE
+ foreach (TypeContainer tc in type_container_resolve_order)
+ tc.ResolveType ();
+#endif
foreach (TypeContainer tc in type_container_resolve_order)
tc.DefineMembers ();
}