public virtual Class VisitClass(Class Class){ return (Class)this.VisitTypeNode(Class); }
internal static TypeNode/*!*/ GetDummyTypeNode(AssemblyNode declaringAssembly, string/*!*/ nspace, string/*!*/ name, ElementType typeCode) { TypeNode result = null; switch (typeCode) { case ElementType.Object: case ElementType.String: case ElementType.Class: if (name.Length > 1 && name[0] == 'I' && char.IsUpper(name[1])) result = new Interface(); else if (name == "MulticastDelegate" || name == "Delegate") result = new Class(); else if (name.EndsWith("Callback") || name.EndsWith("Delegate") || name == "ThreadStart" || name == "FrameGuardGetter" || name == "GuardThreadStart") result = new DelegateNode(); else result = new Class(); break; default: if (name == "CciMemberKind") result = new EnumNode(); else result = new Struct(); break; } result.Name = Identifier.For(name); result.Namespace = Identifier.For(nspace); result.DeclaringModule = declaringAssembly; return result; }
public virtual void VisitClass(Class Class) { this.VisitTypeNode(Class); }
public static void Initialize(bool doNotLockFile, bool getDebugInfo){ if (CoreSystemTypes.Initialized) CoreSystemTypes.Clear(); if (SystemAssembly == null) SystemAssembly = CoreSystemTypes.GetSystemAssembly(doNotLockFile, getDebugInfo); if (SystemAssembly == null) throw new InvalidOperationException(ExceptionStrings.InternalCompilerError); if (TargetPlatform.TargetVersion == null){ TargetPlatform.TargetVersion = SystemAssembly.Version; if (TargetPlatform.TargetVersion == null) TargetPlatform.TargetVersion = typeof(object).Module.Assembly.GetName().Version; } if (TargetPlatform.TargetVersion != null){ if (TargetPlatform.TargetVersion.Major > 1 || TargetPlatform.TargetVersion.Minor > 1 || (TargetPlatform.TargetVersion.Minor == 1 && TargetPlatform.TargetVersion.Build == 9999)){ if (SystemAssembly.IsValidTypeName(StandardIds.System, Identifier.For("Nullable`1"))) TargetPlatform.GenericTypeNamesMangleChar = '`'; else if (SystemAssembly.IsValidTypeName(StandardIds.System, Identifier.For("Nullable!1"))) TargetPlatform.GenericTypeNamesMangleChar = '!'; else if (TargetPlatform.TargetVersion.Major == 1 && TargetPlatform.TargetVersion.Minor == 2) TargetPlatform.GenericTypeNamesMangleChar = (char)0; } } // This must be done in the order: Object, ValueType, Char, String // or else some of the generic type instantiations don't get filled // in correctly. (String ends up implementing IEnumerable<string> // instead of IEnumerable<char>.) Object = (Class)GetTypeNodeFor("System", "Object", ElementType.Object); ValueType = (Class)GetTypeNodeFor("System", "ValueType", ElementType.Class); Char = (Struct)GetTypeNodeFor("System", "Char", ElementType.Char); String = (Class)GetTypeNodeFor("System", "String", ElementType.String); Enum = (Class)GetTypeNodeFor("System", "Enum", ElementType.Class); MulticastDelegate = (Class)GetTypeNodeFor("System", "MulticastDelegate", ElementType.Class); Array = (Class)GetTypeNodeFor("System", "Array", ElementType.Class); Type = (Class)GetTypeNodeFor("System", "Type", ElementType.Class); Boolean = (Struct)GetTypeNodeFor("System", "Boolean", ElementType.Boolean); Int8 = (Struct)GetTypeNodeFor("System", "SByte", ElementType.Int8); UInt8 = (Struct)GetTypeNodeFor("System", "Byte", ElementType.UInt8); Int16 = (Struct)GetTypeNodeFor("System", "Int16", ElementType.Int16); UInt16 = (Struct)GetTypeNodeFor("System", "UInt16", ElementType.UInt16); Int32 = (Struct)GetTypeNodeFor("System", "Int32", ElementType.Int32); UInt32 = (Struct)GetTypeNodeFor("System", "UInt32", ElementType.UInt32); Int64 = (Struct)GetTypeNodeFor("System", "Int64", ElementType.Int64); UInt64 = (Struct)GetTypeNodeFor("System", "UInt64", ElementType.UInt64); Single = (Struct)GetTypeNodeFor("System", "Single", ElementType.Single); Double = (Struct)GetTypeNodeFor("System", "Double", ElementType.Double); IntPtr = (Struct)GetTypeNodeFor("System", "IntPtr", ElementType.IntPtr); UIntPtr = (Struct)GetTypeNodeFor("System", "UIntPtr", ElementType.UIntPtr); DynamicallyTypedReference = (Struct)GetTypeNodeFor("System", "TypedReference", ElementType.DynamicallyTypedReference); #if !MinimalReader Delegate = (Class)GetTypeNodeFor("System", "Delegate", ElementType.Class); Exception = (Class)GetTypeNodeFor("System", "Exception", ElementType.Class); Attribute = (Class)GetTypeNodeFor("System", "Attribute", ElementType.Class); DBNull = (Class)GetTypeNodeFor("System", "DBNull", ElementType.Class); DateTime = (Struct)GetTypeNodeFor("System", "DateTime", ElementType.ValueType); Decimal = (Struct)GetTypeNodeFor("System", "Decimal", ElementType.ValueType); #endif ArgIterator = (Struct)GetTypeNodeFor("System", "ArgIterator", ElementType.ValueType); IsVolatile = (Class)GetTypeNodeFor("System.Runtime.CompilerServices", "IsVolatile", ElementType.Class); Void = (Struct)GetTypeNodeFor("System", "Void", ElementType.Void); RuntimeFieldHandle = (Struct)GetTypeNodeFor("System", "RuntimeFieldHandle", ElementType.ValueType); RuntimeMethodHandle = (Struct)GetTypeNodeFor("System", "RuntimeMethodHandle", ElementType.ValueType); RuntimeTypeHandle = (Struct)GetTypeNodeFor("System", "RuntimeTypeHandle", ElementType.ValueType); #if !MinimalReader RuntimeArgumentHandle = (Struct)GetTypeNodeFor("System", "RuntimeArgumentHandle", ElementType.ValueType); #endif SecurityAction = GetTypeNodeFor("System.Security.Permissions", "SecurityAction", ElementType.ValueType) as EnumNode; CoreSystemTypes.Initialized = true; CoreSystemTypes.InstantiateGenericInterfaces(); #if !NoWriter Literal.Initialize(); #endif object dummy = TargetPlatform.AssemblyReferenceFor; //Force selection of target platform if (dummy == null) return; }
private static void ClearStatics(){ //Special base types Object = null; String = null; ValueType = null; Enum = null; MulticastDelegate = null; Array = null; Type = null; #if !MinimalReader Delegate = null; Exception = null; Attribute = null; #endif //primitive types Boolean = null; Char = null; Int8 = null; UInt8 = null; Int16 = null; UInt16 = null; Int32 = null; UInt32 = null; Int64 = null; UInt64 = null; Single = null; Double = null; IntPtr = null; UIntPtr = null; DynamicallyTypedReference = null; //Special types #if !MinimalReader DBNull = null; DateTime = null; Decimal = null; RuntimeArgumentHandle = null; #endif ArgIterator = null; RuntimeFieldHandle = null; RuntimeMethodHandle = null; RuntimeTypeHandle = null; IsVolatile = null; Void = null; SecurityAction = null; }
public static void Clear(){ lock (Module.GlobalLock){ if (ExtendedRuntimeTypes.SystemCompilerRuntimeAssembly != AssemblyNode.Dummy && ExtendedRuntimeTypes.SystemCompilerRuntimeAssembly != null) { ExtendedRuntimeTypes.SystemCompilerRuntimeAssembly.Dispose(); ExtendedRuntimeTypes.SystemCompilerRuntimeAssembly = null; } ConstrainedType = null; ITemplateParameter = null; ITemplate = null; NullableType = null; NonNullType = null; NotNullAttribute = null; NotNullGenericArgumentsAttribute = null; DelayedAttribute = null; NotDelayedAttribute = null; EncodedTypeSpecAttribute = null; StrictReadonlyAttribute = null; TupleType = null; TypeAlias = null; TypeDefinition = null; TypeIntersection = null; TypeUnion = null; nonNullTypeAssertInitialized = null; nonNullTypeAssertInitializedGeneric = null; } }
public static void Initialize(bool doNotLockFile, bool getDebugInfo) { SystemCompilerRuntimeAssembly = ExtendedRuntimeTypes.GetSystemCompilerRuntimeAssembly(doNotLockFile, getDebugInfo); if (SystemCompilerRuntimeAssembly == null) throw new InvalidOperationException(ExceptionStrings.InternalCompilerError); #if CCINamespace const string CciNs = "Microsoft.Cci"; const string ContractsNs = "Microsoft.Contracts"; //const string CompilerGuardsNs = "Microsoft.Contracts"; #else const string CciNs = "System.Compiler"; const string ContractsNs = "Microsoft.Contracts"; //const string CompilerGuardsNs = "Microsoft.Contracts"; #endif ConstrainedType = (Interface)GetCompilerRuntimeTypeNodeFor("StructuralTypes", "IConstrainedType", ElementType.Class); ITemplateParameter = (Interface)GetCompilerRuntimeTypeNodeFor(CciNs, "ITemplateParameter", ElementType.Class); ITemplate = (Interface)GetCompilerRuntimeTypeNodeFor(CciNs, "ITemplate", ElementType.Class); NullableType = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "NullableType", ElementType.Class); NonNullType = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "NonNullType", ElementType.Class); NotNullAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "NotNullAttribute", ElementType.Class); NotNullGenericArgumentsAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "NotNullGenericArgumentsAttribute", ElementType.Class); DelayedAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "DelayedAttribute", ElementType.Class); NotDelayedAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "NotDelayedAttribute", ElementType.Class); EncodedTypeSpecAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "EncodedTypeSpecAttribute", ElementType.Class); StrictReadonlyAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "StrictReadonlyAttribute", ElementType.Class); TupleType = (Interface)GetCompilerRuntimeTypeNodeFor("StructuralTypes", "ITupleType", ElementType.Class); TypeAlias = (Interface)GetCompilerRuntimeTypeNodeFor("StructuralTypes", "ITypeAlias", ElementType.Class); TypeDefinition = (Interface)GetCompilerRuntimeTypeNodeFor("StructuralTypes", "ITypeDefinition", ElementType.Class); TypeIntersection = (Interface)GetCompilerRuntimeTypeNodeFor("StructuralTypes", "ITypeIntersection", ElementType.Class); TypeUnion = (Interface)GetCompilerRuntimeTypeNodeFor("StructuralTypes", "ITypeUnion", ElementType.Class); }
private static void ClearStatics(){ AttributeUsageAttribute = null; ConditionalAttribute = null; DefaultMemberAttribute = null; InternalsVisibleToAttribute = null; ObsoleteAttribute = null; GenericICollection = null; GenericIEnumerable = null; GenericIList = null; ICloneable = null; ICollection = null; IEnumerable = null; IList = null; #if !MinimalReader //Special attributes AllowPartiallyTrustedCallersAttribute = null; AssemblyCompanyAttribute = null; AssemblyConfigurationAttribute = null; AssemblyCopyrightAttribute = null; AssemblyCultureAttribute = null; AssemblyDelaySignAttribute = null; AssemblyDescriptionAttribute = null; AssemblyFileVersionAttribute = null; AssemblyFlagsAttribute = null; AssemblyInformationalVersionAttribute = null; AssemblyKeyFileAttribute = null; AssemblyKeyNameAttribute = null; AssemblyProductAttribute = null; AssemblyTitleAttribute = null; AssemblyTrademarkAttribute = null; AssemblyVersionAttribute = null; ClassInterfaceAttribute = null; CLSCompliantAttribute = null; ComImportAttribute = null; ComRegisterFunctionAttribute = null; ComSourceInterfacesAttribute = null; ComUnregisterFunctionAttribute = null; ComVisibleAttribute = null; DebuggableAttribute = null; DebuggerHiddenAttribute = null; DebuggerStepThroughAttribute = null; DebuggingModes = null; DllImportAttribute = null; FieldOffsetAttribute = null; FlagsAttribute = null; GuidAttribute = null; ImportedFromTypeLibAttribute = null; InAttribute = null; IndexerNameAttribute = null; InterfaceTypeAttribute = null; MethodImplAttribute = null; NonSerializedAttribute = null; OptionalAttribute = null; OutAttribute = null; ParamArrayAttribute = null; RuntimeCompatibilityAttribute = null; SatelliteContractVersionAttribute = null; SerializableAttribute = null; SecurityAttribute = null; SecurityCriticalAttribute = null; SecurityTransparentAttribute = null; SecurityTreatAsSafeAttribute = null; STAThreadAttribute = null; StructLayoutAttribute = null; SuppressMessageAttribute = null; SuppressUnmanagedCodeSecurityAttribute = null; SecurityAction = null; //Classes need for System.TypeCode DBNull = null; DateTime = null; TimeSpan = null; //Classes and interfaces used by the Framework Activator = null; AppDomain = null; ApplicationException = null; ArgumentException = null; ArgumentNullException = null; ArgumentOutOfRangeException = null; ArrayList = null; AsyncCallback = null; Assembly = null; CodeAccessPermission = null; CollectionBase = null; CultureInfo = null; DictionaryBase = null; DictionaryEntry = null; DuplicateWaitObjectException = null; Environment = null; EventArgs = null; ExecutionEngineException = null; GenericArraySegment = null; #if !WHIDBEYwithGenerics GenericArrayToIEnumerableAdapter = null; #endif GenericDictionary = null; GenericIComparable = null; GenericIComparer = null; GenericIDictionary = null; GenericIEnumerator = null; GenericKeyValuePair = null; GenericList = null; GenericNullable = null; GenericQueue = null; GenericSortedDictionary = null; GenericStack = null; GC = null; Guid = null; __HandleProtector = null; HandleRef = null; Hashtable = null; IASyncResult = null; IComparable = null; IDictionary = null; IComparer = null; IDisposable = null; IEnumerator = null; IFormatProvider = null; IHashCodeProvider = null; IMembershipCondition = null; IndexOutOfRangeException = null; InvalidCastException = null; InvalidOperationException = null; IPermission = null; ISerializable = null; IStackWalk = null; Marshal = null; MarshalByRefObject = null; MemberInfo = null; NativeOverlapped = null; Monitor = null; NotSupportedException = null; NullReferenceException = null; OutOfMemoryException = null; ParameterInfo = null; Queue = null; ReadOnlyCollectionBase = null; ResourceManager = null; ResourceSet = null; SerializationInfo = null; Stack = null; StackOverflowException = null; Stream = null; StreamingContext = null; StringBuilder = null; StringComparer = null; StringComparison = null; SystemException = null; Thread = null; WindowsImpersonationContext = null; #endif #if ExtendedRuntime AnonymousAttribute = null; AnonymityEnum = null; ComposerAttribute = null; CustomVisitorAttribute = null; TemplateAttribute = null; TemplateInstanceAttribute = null; UnmanagedStructTemplateParameterAttribute = null; TemplateParameterFlagsAttribute = null; GenericBoxed = null; GenericIEnumerableToGenericIListAdapter = null; GenericInvariant = null; GenericNonEmptyIEnumerable = null; GenericNonNull = null; GenericStreamUtility = null; GenericUnboxer = null; ElementTypeAttribute = null; IDbTransactable = null; IAggregate = null; IAggregateGroup = null; StreamNotSingletonException = null; SqlHint = null; SqlFunctions = null; XmlAttributeAttributeClass = null; XmlChoiceIdentifierAttributeClass = null; XmlElementAttributeClass = null; XmlIgnoreAttributeClass = null; XmlTypeAttributeClass = null; INullable = null; SqlBinary = null; SqlBoolean = null; SqlByte = null; SqlDateTime = null; SqlDecimal = null; SqlDouble = null; SqlGuid = null; SqlInt16 = null; SqlInt32 = null; SqlInt64 = null; SqlMoney = null; SqlSingle = null; SqlString = null; IDbConnection = null; IDbTransaction = null; IsolationLevel = null; //OrdinaryExceptions NoChoiceException = null; IllegalUpcastException = null; //NonNull Range = null; //Invariants InitGuardSetsDelegate = null; CheckInvariantDelegate = null; ObjectInvariantException = null; ThreadConditionDelegate = null; GuardThreadStart = null; Guard = null; ContractMarkers = null; //IReduction = null; AssertHelpers = null; ThreadStart = null; //CheckedExceptions ICheckedException = null; CheckedException = null; // Contracts UnreachableException = null; ContractException = null; NullTypeException = null; AssertException = null; AssumeException = null; InvalidContractException = null; RequiresException = null; EnsuresException = null; ModifiesException = null; ThrowsException = null; DoesException = null; InvariantException = null; ContractMarkerException = null; PreAllocatedExceptions = null; AdditiveAttribute = null; InsideAttribute = null; SpecPublicAttribute = null; SpecProtectedAttribute = null; SpecInternalAttribute = null; PureAttribute = null; OwnedAttribute = null; RepAttribute = null; PeerAttribute = null; CapturedAttribute = null; LockProtectedAttribute = null; RequiresLockProtectedAttribute = null; ImmutableAttribute = null; RequiresImmutableAttribute = null; RequiresCanWriteAttribute = null; StateIndependentAttribute = null; ConfinedAttribute = null; ModelfieldContractAttribute = null; ModelfieldAttribute = null; SatisfiesAttribute = null; ModelfieldException = null; /* Diego's Attributes for Purity Analysis and Write effects */ OnceAttribute = null; WriteConfinedAttribute = null; WriteAttribute = null; ReadAttribute = null; GlobalReadAttribute = null; GlobalWriteAttribute = null; GlobalAccessAttribute = null; FreshAttribute = null; EscapesAttribute = null; /* */ ModelAttribute = null; RequiresAttribute = null; EnsuresAttribute = null; ModifiesAttribute = null; HasWitnessAttribute = null; WitnessAttribute = null; InferredReturnValueAttribute = null; ThrowsAttribute = null; DoesAttribute = null; InvariantAttribute = null; NoDefaultActivityAttribute = null; NoDefaultContractAttribute = null; ReaderAttribute = null; ShadowsAssemblyAttribute = null; VerifyAttribute = null; DependentAttribute = null; ElementsRepAttribute = null; ElementsPeerAttribute = null; ElementAttribute = null; ElementCollectionAttribute = null; RecursionTerminationAttribute = null; NoReferenceComparisonAttribute = null; ResultNotNewlyAllocatedAttribute = null; noHeapAllocationAttribute = null; #endif }
public static void Initialize(bool doNotLockFile, bool getDebugInfo){ if (SystemTypes.Initialized){ SystemTypes.Clear(); CoreSystemTypes.Initialize(doNotLockFile, getDebugInfo); #if ExtendedRuntime ExtendedRuntimeTypes.Initialize(doNotLockFile, getDebugInfo); #endif }else if (!CoreSystemTypes.Initialized){ CoreSystemTypes.Initialize(doNotLockFile, getDebugInfo); #if ExtendedRuntime ExtendedRuntimeTypes.Clear(); ExtendedRuntimeTypes.Initialize(doNotLockFile, getDebugInfo); #endif } if (TargetPlatform.TargetVersion == null){ TargetPlatform.TargetVersion = SystemAssembly.Version; if (TargetPlatform.TargetVersion == null) TargetPlatform.TargetVersion = typeof(object).Module.Assembly.GetName().Version; } //TODO: throw an exception when the result is null #if ExtendedRuntime #if !NoData && !ROTOR SystemDataAssembly = SystemTypes.GetSystemDataAssembly(doNotLockFile, getDebugInfo); #endif #if !NoXml && !NoRuntimeXml SystemXmlAssembly = SystemTypes.GetSystemXmlAssembly(doNotLockFile, getDebugInfo); #endif #endif AttributeUsageAttribute = (Class)GetTypeNodeFor("System", "AttributeUsageAttribute", ElementType.Class); ConditionalAttribute = (Class)GetTypeNodeFor("System.Diagnostics", "ConditionalAttribute", ElementType.Class); DefaultMemberAttribute = (Class)GetTypeNodeFor("System.Reflection", "DefaultMemberAttribute", ElementType.Class); InternalsVisibleToAttribute = (Class)GetTypeNodeFor("System.Runtime.CompilerServices", "InternalsVisibleToAttribute", ElementType.Class); ObsoleteAttribute = (Class)GetTypeNodeFor("System", "ObsoleteAttribute", ElementType.Class); GenericICollection = (Interface)GetGenericRuntimeTypeNodeFor("System.Collections.Generic", "ICollection", 1, ElementType.Class); GenericIEnumerable = (Interface)GetGenericRuntimeTypeNodeFor("System.Collections.Generic", "IEnumerable", 1, ElementType.Class); GenericIList = (Interface)GetGenericRuntimeTypeNodeFor("System.Collections.Generic", "IList", 1, ElementType.Class); ICloneable = (Interface)GetTypeNodeFor("System", "ICloneable", ElementType.Class); ICollection = (Interface)GetTypeNodeFor("System.Collections", "ICollection", ElementType.Class); IEnumerable = (Interface)GetTypeNodeFor("System.Collections", "IEnumerable", ElementType.Class); IList = (Interface)GetTypeNodeFor("System.Collections", "IList", ElementType.Class); #if !MinimalReader AllowPartiallyTrustedCallersAttribute = (Class)GetTypeNodeFor("System.Security", "AllowPartiallyTrustedCallersAttribute", ElementType.Class); AssemblyCompanyAttribute = (Class)GetTypeNodeFor("System.Reflection", "AssemblyCompanyAttribute", ElementType.Class); AssemblyConfigurationAttribute = (Class)GetTypeNodeFor("System.Reflection", "AssemblyConfigurationAttribute", ElementType.Class); AssemblyCopyrightAttribute = (Class)GetTypeNodeFor("System.Reflection", "AssemblyCopyrightAttribute", ElementType.Class); AssemblyCultureAttribute = (Class)GetTypeNodeFor("System.Reflection", "AssemblyCultureAttribute", ElementType.Class); AssemblyDelaySignAttribute = (Class)GetTypeNodeFor("System.Reflection", "AssemblyDelaySignAttribute", ElementType.Class); AssemblyDescriptionAttribute = (Class)GetTypeNodeFor("System.Reflection", "AssemblyDescriptionAttribute", ElementType.Class); AssemblyFileVersionAttribute = (Class)GetTypeNodeFor("System.Reflection", "AssemblyFileVersionAttribute", ElementType.Class); AssemblyFlagsAttribute = (Class)GetTypeNodeFor("System.Reflection", "AssemblyFlagsAttribute", ElementType.Class); AssemblyInformationalVersionAttribute = (Class)GetTypeNodeFor("System.Reflection", "AssemblyInformationalVersionAttribute", ElementType.Class); AssemblyKeyFileAttribute = (Class)GetTypeNodeFor("System.Reflection", "AssemblyKeyFileAttribute", ElementType.Class); AssemblyKeyNameAttribute = (Class)GetTypeNodeFor("System.Reflection", "AssemblyKeyNameAttribute", ElementType.Class); AssemblyProductAttribute = (Class)GetTypeNodeFor("System.Reflection", "AssemblyProductAttribute", ElementType.Class); AssemblyTitleAttribute = (Class)GetTypeNodeFor("System.Reflection", "AssemblyTitleAttribute", ElementType.Class); AssemblyTrademarkAttribute = (Class)GetTypeNodeFor("System.Reflection", "AssemblyTrademarkAttribute", ElementType.Class); AssemblyVersionAttribute = (Class)GetTypeNodeFor("System.Reflection", "AssemblyVersionAttribute", ElementType.Class); ClassInterfaceAttribute = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "ClassInterfaceAttribute", ElementType.Class); CLSCompliantAttribute = (Class)GetTypeNodeFor("System", "CLSCompliantAttribute", ElementType.Class); ComImportAttribute = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "ComImportAttribute", ElementType.Class); ComRegisterFunctionAttribute = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "ComRegisterFunctionAttribute", ElementType.Class); ComSourceInterfacesAttribute = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "ComSourceInterfacesAttribute", ElementType.Class); ComUnregisterFunctionAttribute = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "ComUnregisterFunctionAttribute", ElementType.Class); ComVisibleAttribute = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "ComVisibleAttribute", ElementType.Class); DebuggableAttribute = (Class)GetTypeNodeFor("System.Diagnostics", "DebuggableAttribute", ElementType.Class); DebuggerHiddenAttribute = (Class)GetTypeNodeFor("System.Diagnostics", "DebuggerHiddenAttribute", ElementType.Class); DebuggerStepThroughAttribute = (Class)GetTypeNodeFor("System.Diagnostics", "DebuggerStepThroughAttribute", ElementType.Class); DebuggingModes = DebuggableAttribute == null ? null : DebuggableAttribute.GetNestedType(Identifier.For("DebuggingModes")) as EnumNode; DllImportAttribute = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "DllImportAttribute", ElementType.Class); FieldOffsetAttribute = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "FieldOffsetAttribute", ElementType.Class); FlagsAttribute = (Class)GetTypeNodeFor("System", "FlagsAttribute", ElementType.Class); Guid = (Struct)GetTypeNodeFor("System", "Guid", ElementType.ValueType); GuidAttribute = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "GuidAttribute", ElementType.Class); ImportedFromTypeLibAttribute = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "ImportedFromTypeLibAttribute", ElementType.Class); InAttribute = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "InAttribute", ElementType.Class); IndexerNameAttribute = (Class)GetTypeNodeFor("System.Runtime.CompilerServices", "IndexerNameAttribute", ElementType.Class); InterfaceTypeAttribute = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "InterfaceTypeAttribute", ElementType.Class); MethodImplAttribute = (Class)GetTypeNodeFor("System.Runtime.CompilerServices", "MethodImplAttribute", ElementType.Class); NonSerializedAttribute = (Class)GetTypeNodeFor("System", "NonSerializedAttribute", ElementType.Class); OptionalAttribute = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "OptionalAttribute", ElementType.Class); OutAttribute = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "OutAttribute", ElementType.Class); ParamArrayAttribute = (Class)GetTypeNodeFor("System", "ParamArrayAttribute", ElementType.Class); RuntimeCompatibilityAttribute = (Class)GetTypeNodeFor("System.Runtime.CompilerServices", "RuntimeCompatibilityAttribute", ElementType.Class); SatelliteContractVersionAttribute = (Class)GetTypeNodeFor("System.Resources", "SatelliteContractVersionAttribute", ElementType.Class); SerializableAttribute = (Class)GetTypeNodeFor("System", "SerializableAttribute", ElementType.Class); SecurityAttribute = (Class)GetTypeNodeFor("System.Security.Permissions", "SecurityAttribute", ElementType.Class); SecurityCriticalAttribute = (Class)GetTypeNodeFor("System.Security", "SecurityCriticalAttribute", ElementType.Class); SecurityTransparentAttribute = (Class)GetTypeNodeFor("System.Security", "SecurityTransparentAttribute", ElementType.Class); SecurityTreatAsSafeAttribute = (Class)GetTypeNodeFor("System.Security", "SecurityTreatAsSafeAttribute", ElementType.Class); STAThreadAttribute = (Class)GetTypeNodeFor("System", "STAThreadAttribute", ElementType.Class); StructLayoutAttribute = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "StructLayoutAttribute", ElementType.Class); SuppressMessageAttribute = (Class)GetTypeNodeFor("System.Diagnostics.CodeAnalysis", "SuppressMessageAttribute", ElementType.Class); SuppressUnmanagedCodeSecurityAttribute = (Class)GetTypeNodeFor("System.Security", "SuppressUnmanagedCodeSecurityAttribute", ElementType.Class); SecurityAction = GetTypeNodeFor("System.Security.Permissions", "SecurityAction", ElementType.ValueType) as EnumNode; DBNull = (Class)GetTypeNodeFor("System", "DBNull", ElementType.Class); DateTime = (Struct)GetTypeNodeFor("System", "DateTime", ElementType.ValueType); TimeSpan = (Struct)GetTypeNodeFor("System", "TimeSpan", ElementType.ValueType); Activator = (Class)GetTypeNodeFor("System", "Activator", ElementType.Class); AppDomain = (Class)GetTypeNodeFor("System", "AppDomain", ElementType.Class); ApplicationException = (Class)GetTypeNodeFor("System", "ApplicationException", ElementType.Class); ArgumentException = (Class)GetTypeNodeFor("System", "ArgumentException", ElementType.Class); ArgumentNullException = (Class)GetTypeNodeFor("System", "ArgumentNullException", ElementType.Class); ArgumentOutOfRangeException = (Class)GetTypeNodeFor("System", "ArgumentOutOfRangeException", ElementType.Class); ArrayList = (Class)GetTypeNodeFor("System.Collections", "ArrayList", ElementType.Class); AsyncCallback = (DelegateNode)GetTypeNodeFor("System", "AsyncCallback", ElementType.Class); Assembly = (Class)GetTypeNodeFor("System.Reflection", "Assembly", ElementType.Class); CodeAccessPermission = (Class)GetTypeNodeFor("System.Security", "CodeAccessPermission", ElementType.Class); CollectionBase = (Class)GetTypeNodeFor("System.Collections", "CollectionBase", ElementType.Class); CultureInfo = (Class)GetTypeNodeFor("System.Globalization", "CultureInfo", ElementType.Class); DictionaryBase = (Class)GetTypeNodeFor("System.Collections", "DictionaryBase", ElementType.Class); DictionaryEntry = (Struct)GetTypeNodeFor("System.Collections", "DictionaryEntry", ElementType.ValueType); DuplicateWaitObjectException = (Class)GetTypeNodeFor("System", "DuplicateWaitObjectException", ElementType.Class); Environment = (Class)GetTypeNodeFor("System", "Environment", ElementType.Class); EventArgs = (Class)GetTypeNodeFor("System", "EventArgs", ElementType.Class); ExecutionEngineException = (Class)GetTypeNodeFor("System", "ExecutionEngineException", ElementType.Class); GenericArraySegment = (Struct)GetGenericRuntimeTypeNodeFor("System", "ArraySegment", 1, ElementType.ValueType); GenericDictionary = (Class)GetGenericRuntimeTypeNodeFor("System.Collections.Generic", "Dictionary", 2, ElementType.Class); GenericIComparable = (Interface)GetGenericRuntimeTypeNodeFor("System.Collections.Generic", "IComparable", 1, ElementType.Class); GenericIComparer = (Interface)GetGenericRuntimeTypeNodeFor("System.Collections.Generic", "IComparer", 1, ElementType.Class); GenericIDictionary = (Interface)GetGenericRuntimeTypeNodeFor("System.Collections.Generic", "IDictionary", 2, ElementType.Class); GenericIEnumerator = (Interface)GetGenericRuntimeTypeNodeFor("System.Collections.Generic", "IEnumerator", 1, ElementType.Class); GenericKeyValuePair = (Struct)GetGenericRuntimeTypeNodeFor("System.Collections.Generic", "KeyValuePair", 2, ElementType.ValueType); GenericList = (Class)GetGenericRuntimeTypeNodeFor("System.Collections.Generic", "List", 1, ElementType.Class); GenericNullable = (Struct)GetGenericRuntimeTypeNodeFor("System", "Nullable", 1, ElementType.ValueType); GenericQueue = (Class)GetGenericRuntimeTypeNodeFor("System.Collections.Generic", "Queue", 1, ElementType.Class); GenericSortedDictionary = (Class)GetGenericRuntimeTypeNodeFor("System.Collections.Generic", "SortedDictionary", 2, ElementType.Class); GenericStack = (Class)GetGenericRuntimeTypeNodeFor("System.Collections.Generic", "Stack", 1, ElementType.Class); GC = (Class)GetTypeNodeFor("System", "GC", ElementType.Class); __HandleProtector = (Class)GetTypeNodeFor("System.Threading", "__HandleProtector", ElementType.Class); HandleRef = (Struct)GetTypeNodeFor("System.Runtime.InteropServices", "HandleRef", ElementType.ValueType); Hashtable = (Class)GetTypeNodeFor("System.Collections", "Hashtable", ElementType.Class); IASyncResult = (Interface)GetTypeNodeFor("System", "IAsyncResult", ElementType.Class); IComparable = (Interface)GetTypeNodeFor("System", "IComparable", ElementType.Class); IComparer = (Interface)GetTypeNodeFor("System.Collections", "IComparer", ElementType.Class); IDictionary = (Interface)GetTypeNodeFor("System.Collections", "IDictionary", ElementType.Class); IDisposable = (Interface)GetTypeNodeFor("System", "IDisposable", ElementType.Class); IEnumerator = (Interface)GetTypeNodeFor("System.Collections", "IEnumerator", ElementType.Class); IFormatProvider = (Interface)GetTypeNodeFor("System", "IFormatProvider", ElementType.Class); IHashCodeProvider = (Interface)GetTypeNodeFor("System.Collections", "IHashCodeProvider", ElementType.Class); IMembershipCondition = (Interface)GetTypeNodeFor("System.Security.Policy", "IMembershipCondition", ElementType.Class); IndexOutOfRangeException = (Class)GetTypeNodeFor("System", "IndexOutOfRangeException", ElementType.Class); InvalidCastException = (Class)GetTypeNodeFor("System", "InvalidCastException", ElementType.Class); InvalidOperationException = (Class)GetTypeNodeFor("System", "InvalidOperationException", ElementType.Class); IPermission = (Interface)GetTypeNodeFor("System.Security", "IPermission", ElementType.Class); ISerializable = (Interface)GetTypeNodeFor("System.Runtime.Serialization", "ISerializable", ElementType.Class); IStackWalk = (Interface)GetTypeNodeFor("System.Security", "IStackWalk", ElementType.Class); Marshal = (Class)GetTypeNodeFor("System.Runtime.InteropServices", "Marshal", ElementType.Class); MarshalByRefObject = (Class)GetTypeNodeFor("System", "MarshalByRefObject", ElementType.Class); MemberInfo = (Class)GetTypeNodeFor("System.Reflection", "MemberInfo", ElementType.Class); Monitor = (Class)GetTypeNodeFor("System.Threading", "Monitor", ElementType.Class); NativeOverlapped = (Struct)GetTypeNodeFor("System.Threading", "NativeOverlapped", ElementType.ValueType); NotSupportedException = (Class)GetTypeNodeFor("System", "NotSupportedException", ElementType.Class); NullReferenceException = (Class)GetTypeNodeFor("System", "NullReferenceException", ElementType.Class); OutOfMemoryException = (Class)GetTypeNodeFor("System", "OutOfMemoryException", ElementType.Class); ParameterInfo = (Class)GetTypeNodeFor("System.Reflection", "ParameterInfo", ElementType.Class); Queue = (Class)GetTypeNodeFor("System.Collections", "Queue", ElementType.Class); ReadOnlyCollectionBase = (Class)GetTypeNodeFor("System.Collections", "ReadOnlyCollectionBase", ElementType.Class); ResourceManager = (Class)GetTypeNodeFor("System.Resources", "ResourceManager", ElementType.Class); ResourceSet = (Class)GetTypeNodeFor("System.Resources", "ResourceSet", ElementType.Class); SerializationInfo = (Class)GetTypeNodeFor("System.Runtime.Serialization", "SerializationInfo", ElementType.Class); Stack = (Class)GetTypeNodeFor("System.Collections", "Stack", ElementType.Class); StackOverflowException = (Class)GetTypeNodeFor("System", "StackOverflowException", ElementType.Class); Stream = (Class)GetTypeNodeFor("System.IO", "Stream", ElementType.Class); StreamingContext = (Struct)GetTypeNodeFor("System.Runtime.Serialization", "StreamingContext", ElementType.ValueType); StringBuilder = (Class)GetTypeNodeFor("System.Text", "StringBuilder", ElementType.Class); StringComparer = (Class)GetTypeNodeFor("System", "StringComparer", ElementType.Class); StringComparison = GetTypeNodeFor("System", "StringComparison", ElementType.ValueType) as EnumNode; SystemException = (Class)GetTypeNodeFor("System", "SystemException", ElementType.Class); Thread = (Class)GetTypeNodeFor("System.Threading", "Thread", ElementType.Class); WindowsImpersonationContext = (Class)GetTypeNodeFor("System.Security.Principal", "WindowsImpersonationContext", ElementType.Class); #endif #if ExtendedRuntime #if !NoXml && !NoRuntimeXml XmlAttributeAttributeClass = (Class)GetXmlTypeNodeFor("System.Xml.Serialization", "XmlAttributeAttribute", ElementType.Class); XmlChoiceIdentifierAttributeClass = (Class)GetXmlTypeNodeFor("System.Xml.Serialization", "XmlChoiceIdentifierAttribute", ElementType.Class); XmlElementAttributeClass = (Class)GetXmlTypeNodeFor("System.Xml.Serialization", "XmlElementAttribute", ElementType.Class); XmlIgnoreAttributeClass = (Class)GetXmlTypeNodeFor("System.Xml.Serialization", "XmlIgnoreAttribute", ElementType.Class); XmlTypeAttributeClass = (Class)GetXmlTypeNodeFor("System.Xml.Serialization", "XmlTypeAttribute", ElementType.Class); #endif #if !NoData INullable = (Interface) GetDataTypeNodeFor("System.Data.SqlTypes", "INullable", ElementType.Class); SqlBinary = (Struct)GetDataTypeNodeFor("System.Data.SqlTypes", "SqlBinary", ElementType.ValueType); SqlBoolean = (Struct)GetDataTypeNodeFor("System.Data.SqlTypes", "SqlBoolean", ElementType.ValueType); SqlByte = (Struct)GetDataTypeNodeFor("System.Data.SqlTypes", "SqlByte", ElementType.ValueType); SqlDateTime = (Struct)GetDataTypeNodeFor("System.Data.SqlTypes", "SqlDateTime", ElementType.ValueType); SqlDecimal = (Struct)GetDataTypeNodeFor("System.Data.SqlTypes", "SqlDecimal", ElementType.ValueType); SqlDouble = (Struct)GetDataTypeNodeFor("System.Data.SqlTypes", "SqlDouble", ElementType.ValueType); SqlGuid = (Struct)GetDataTypeNodeFor("System.Data.SqlTypes", "SqlGuid", ElementType.ValueType); SqlInt16 = (Struct)GetDataTypeNodeFor("System.Data.SqlTypes", "SqlInt16", ElementType.ValueType); SqlInt32 = (Struct)GetDataTypeNodeFor("System.Data.SqlTypes", "SqlInt32", ElementType.ValueType); SqlInt64 = (Struct)GetDataTypeNodeFor("System.Data.SqlTypes", "SqlInt64", ElementType.ValueType); SqlMoney = (Struct)GetDataTypeNodeFor("System.Data.SqlTypes", "SqlMoney", ElementType.ValueType); SqlSingle = (Struct)GetDataTypeNodeFor("System.Data.SqlTypes", "SqlSingle", ElementType.ValueType); SqlString = (Struct)GetDataTypeNodeFor("System.Data.SqlTypes", "SqlString", ElementType.ValueType); IDbConnection = (Interface)GetDataTypeNodeFor("System.Data", "IDbConnection", ElementType.Class); IDbTransaction = (Interface)GetDataTypeNodeFor("System.Data", "IDbTransaction", ElementType.Class); IsolationLevel = GetDataTypeNodeFor("System.Data", "IsolationLevel", ElementType.ValueType) as EnumNode; #endif #if CCINamespace const string CciNs = "Microsoft.Cci"; const string ContractsNs = "Microsoft.Contracts"; const string CompilerGuardsNs = "Microsoft.Contracts"; #else const string CciNs = "System.Compiler"; const string ContractsNs = "Microsoft.Contracts"; const string CompilerGuardsNs = "Microsoft.Contracts"; #endif const string GuardsNs = "Microsoft.Contracts"; AnonymousAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CciNs, "AnonymousAttribute", ElementType.Class); AnonymityEnum = GetCompilerRuntimeTypeNodeFor(CciNs, "Anonymity", ElementType.ValueType); ComposerAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CciNs, "ComposerAttribute", ElementType.Class); CustomVisitorAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CciNs, "CustomVisitorAttribute", ElementType.Class); TemplateAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CciNs, "TemplateAttribute", ElementType.Class); TemplateInstanceAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CciNs, "TemplateInstanceAttribute", ElementType.Class); UnmanagedStructTemplateParameterAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CciNs, "UnmanagedStructTemplateParameterAttribute", ElementType.Class); TemplateParameterFlagsAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CciNs, "TemplateParameterFlagsAttribute", ElementType.Class); #if !WHIDBEYwithGenerics GenericArrayToIEnumerableAdapter = (Class)GetCompilerRuntimeTypeNodeFor("StructuralTypes", "ArrayToIEnumerableAdapter", 1, ElementType.Class); #endif GenericBoxed = (Struct)GetCompilerRuntimeTypeNodeFor("StructuralTypes", "Boxed", 1, ElementType.ValueType); GenericIEnumerableToGenericIListAdapter = (Class)GetCompilerRuntimeTypeNodeFor("StructuralTypes", "GenericIEnumerableToGenericIListAdapter", 1, ElementType.Class); GenericInvariant = (Struct)GetCompilerRuntimeTypeNodeFor("StructuralTypes", "Invariant", 1, ElementType.ValueType); GenericNonEmptyIEnumerable = (Struct)GetCompilerRuntimeTypeNodeFor("StructuralTypes", "NonEmptyIEnumerable", 1, ElementType.ValueType); GenericNonNull = (Struct)GetCompilerRuntimeTypeNodeFor("StructuralTypes", "NonNull", 1, ElementType.ValueType); GenericStreamUtility = (Class)GetCompilerRuntimeTypeNodeFor("StructuralTypes", "StreamUtility", 1, ElementType.Class); GenericUnboxer = (Class)GetCompilerRuntimeTypeNodeFor("StructuralTypes", "Unboxer", 1, ElementType.Class); ElementTypeAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CciNs, "ElementTypeAttribute", ElementType.Class); IDbTransactable = (Interface)GetCompilerRuntimeTypeNodeFor("System.Data", "IDbTransactable", ElementType.Class); IAggregate = (Interface)GetCompilerRuntimeTypeNodeFor("System.Query", "IAggregate", ElementType.Class); IAggregateGroup = (Interface)GetCompilerRuntimeTypeNodeFor("System.Query", "IAggregateGroup", ElementType.Class); StreamNotSingletonException = (Class)GetCompilerRuntimeTypeNodeFor("System.Query", "StreamNotSingletonException", ElementType.Class); SqlHint = GetCompilerRuntimeTypeNodeFor("System.Query", "SqlHint", ElementType.ValueType) as EnumNode; SqlFunctions = (Class)GetCompilerRuntimeTypeNodeFor("System.Query", "SqlFunctions", ElementType.Class); #region Contracts Range = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "Range", ElementType.Class); //Ordinary Exceptions NoChoiceException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "NoChoiceException", ElementType.Class); IllegalUpcastException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "IllegalUpcastException", ElementType.Class); CciMemberKind = (EnumNode)GetCompilerRuntimeTypeNodeFor(CciNs, "CciMemberKind", ElementType.ValueType); CciMemberKindAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CciNs, "CciMemberKindAttribute", ElementType.Class); //Checked Exceptions ICheckedException = (Interface)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ICheckedException", ElementType.Class); CheckedException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "CheckedException", ElementType.Class); ContractMarkers = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ContractMarkers", ElementType.Class); //Invariant InitGuardSetsDelegate = (DelegateNode) GetCompilerRuntimeTypeNodeFor(GuardsNs, "InitGuardSetsDelegate", ElementType.Class); CheckInvariantDelegate = (DelegateNode) GetCompilerRuntimeTypeNodeFor(GuardsNs, "CheckInvariantDelegate", ElementType.Class); FrameGuardGetter = (DelegateNode) GetCompilerRuntimeTypeNodeFor(GuardsNs, "FrameGuardGetter", ElementType.Class); ObjectInvariantException = (Class)GetCompilerRuntimeTypeNodeFor("Microsoft.Contracts", "ObjectInvariantException", ElementType.Class); ThreadConditionDelegate = (DelegateNode) GetCompilerRuntimeTypeNodeFor(GuardsNs, "ThreadConditionDelegate", ElementType.Class); GuardThreadStart = (DelegateNode) GetCompilerRuntimeTypeNodeFor(GuardsNs, "GuardThreadStart", ElementType.Class); Guard = (Class) GetCompilerRuntimeTypeNodeFor(GuardsNs, "Guard", ElementType.Class); ThreadStart = (DelegateNode) GetTypeNodeFor("System.Threading", "ThreadStart", ElementType.Class); AssertHelpers = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "AssertHelpers", ElementType.Class); #region Exceptions UnreachableException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "UnreachableException", ElementType.Class); ContractException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ContractException", ElementType.Class); NullTypeException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "NullTypeException", ElementType.Class); AssertException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "AssertException", ElementType.Class); AssumeException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "AssumeException", ElementType.Class); InvalidContractException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "InvalidContractException", ElementType.Class); RequiresException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "RequiresException", ElementType.Class); EnsuresException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "EnsuresException", ElementType.Class); ModifiesException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ModifiesException", ElementType.Class); ThrowsException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ThrowsException", ElementType.Class); DoesException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "DoesException", ElementType.Class); InvariantException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "InvariantException", ElementType.Class); ContractMarkerException = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ContractMarkerException", ElementType.Class); PreAllocatedExceptions = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "PreAllocatedExceptions", ElementType.Class); #endregion #region Attributes AdditiveAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "AdditiveAttribute", ElementType.Class); InsideAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "InsideAttribute", ElementType.Class); PureAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "PureAttribute", ElementType.Class); ConfinedAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "ConfinedAttribute", ElementType.Class); #region modelfield attributes and exceptions ModelfieldContractAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ModelfieldContractAttribute", ElementType.Class); ModelfieldAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ModelfieldAttribute", ElementType.Class); SatisfiesAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "SatisfiesAttribute", ElementType.Class); ModelfieldException = (Class)GetCompilerRuntimeTypeNodeFor("Microsoft.Contracts", "ModelfieldException", ElementType.Class); #endregion /* Diego's Attributes for Purity and WriteEffects */ OnceAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "OnceAttribute", ElementType.Class); WriteConfinedAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "WriteConfinedAttribute", ElementType.Class); WriteAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "WriteAttribute", ElementType.Class); ReadAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "ReadAttribute", ElementType.Class); GlobalReadAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "GlobalReadAttribute", ElementType.Class); GlobalWriteAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "GlobalWriteAttribute", ElementType.Class); GlobalAccessAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "GlobalAccessAttribute", ElementType.Class); FreshAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "FreshAttribute", ElementType.Class); EscapesAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "EscapesAttribute", ElementType.Class); /* */ StateIndependentAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "StateIndependentAttribute", ElementType.Class); SpecPublicAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "SpecPublicAttribute", ElementType.Class); SpecProtectedAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "SpecProtectedAttribute", ElementType.Class); SpecInternalAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "SpecInternalAttribute", ElementType.Class); OwnedAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "OwnedAttribute", ElementType.Class); RepAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "RepAttribute", ElementType.Class); PeerAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "PeerAttribute", ElementType.Class); CapturedAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "CapturedAttribute", ElementType.Class); LockProtectedAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "LockProtectedAttribute", ElementType.Class); RequiresLockProtectedAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "RequiresLockProtectedAttribute", ElementType.Class); ImmutableAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "ImmutableAttribute", ElementType.Class); RequiresImmutableAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "RequiresImmutableAttribute", ElementType.Class); RequiresCanWriteAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "RequiresCanWriteAttribute", ElementType.Class); ModelAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ModelAttribute", ElementType.Class); RequiresAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "RequiresAttribute", ElementType.Class); EnsuresAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "EnsuresAttribute", ElementType.Class); ModifiesAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ModifiesAttribute", ElementType.Class); HasWitnessAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "HasWitnessAttribute", ElementType.Class); WitnessAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "WitnessAttribute", ElementType.Class); InferredReturnValueAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "InferredReturnValueAttribute", ElementType.Class); ThrowsAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ThrowsAttribute", ElementType.Class); DoesAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "DoesAttribute", ElementType.Class); InvariantAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "InvariantAttribute", ElementType.Class); NoDefaultActivityAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "NoDefaultActivityAttribute", ElementType.Class); NoDefaultContractAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "NoDefaultContractAttribute", ElementType.Class); ReaderAttribute = (Class)GetCompilerRuntimeTypeNodeFor(CompilerGuardsNs, "ReaderAttribute", ElementType.Class); ShadowsAssemblyAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ShadowsAssemblyAttribute", ElementType.Class); VerifyAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "VerifyAttribute", ElementType.Class); DependentAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "DependentAttribute", ElementType.Class); ElementsRepAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ElementsRepAttribute", ElementType.Class); ElementsPeerAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ElementsPeerAttribute", ElementType.Class); ElementAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ElementAttribute", ElementType.Class); ElementCollectionAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ElementCollectionAttribute", ElementType.Class); RecursionTerminationAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "RecursionTerminationAttribute", ElementType.Class); NoReferenceComparisonAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "NoReferenceComparisonAttribute", ElementType.Class); ResultNotNewlyAllocatedAttribute = (Class)GetCompilerRuntimeTypeNodeFor(ContractsNs, "ResultNotNewlyAllocatedAttribute", ElementType.Class); #endregion #endregion #endif SystemTypes.Initialized = true; object dummy = TargetPlatform.AssemblyReferenceFor; //Force selection of target platform if (dummy == null) return; }
public static void InitializeSystemTypes() { // This must be done in the order: Object, ValueType, Char, String // or else some of the generic type instantiations don't get filled // in correctly. (String ends up implementing IEnumerable<string> // instead of IEnumerable<char>.) Object = (Class)GetTypeNodeFor("System", "Object", ElementType.Object); ValueType = (Class)GetTypeNodeFor("System", "ValueType", ElementType.Class); Char = (Struct)GetTypeNodeFor("System", "Char", ElementType.Char); String = (Class)GetTypeNodeFor("System", "String", ElementType.String); Enum = (Class)GetTypeNodeFor("System", "Enum", ElementType.Class); MulticastDelegate = (Class)GetTypeNodeFor("System", "MulticastDelegate", ElementType.Class); Array = (Class)GetTypeNodeFor("System", "Array", ElementType.Class); Type = (Class)GetTypeNodeFor("System", "Type", ElementType.Class); Boolean = (Struct)GetTypeNodeFor("System", "Boolean", ElementType.Boolean); Int8 = (Struct)GetTypeNodeFor("System", "SByte", ElementType.Int8); UInt8 = (Struct)GetTypeNodeFor("System", "Byte", ElementType.UInt8); Int16 = (Struct)GetTypeNodeFor("System", "Int16", ElementType.Int16); UInt16 = (Struct)GetTypeNodeFor("System", "UInt16", ElementType.UInt16); Int32 = (Struct)GetTypeNodeFor("System", "Int32", ElementType.Int32); UInt32 = (Struct)GetTypeNodeFor("System", "UInt32", ElementType.UInt32); Int64 = (Struct)GetTypeNodeFor("System", "Int64", ElementType.Int64); UInt64 = (Struct)GetTypeNodeFor("System", "UInt64", ElementType.UInt64); Single = (Struct)GetTypeNodeFor("System", "Single", ElementType.Single); Double = (Struct)GetTypeNodeFor("System", "Double", ElementType.Double); IntPtr = (Struct)GetTypeNodeFor("System", "IntPtr", ElementType.IntPtr); UIntPtr = (Struct)GetTypeNodeFor("System", "UIntPtr", ElementType.UIntPtr); DynamicallyTypedReference = (Struct)GetTypeNodeFor("System", "TypedReference", ElementType.DynamicallyTypedReference); #if !MinimalReader Delegate = (Class)GetTypeNodeFor("System", "Delegate", ElementType.Class); Exception = (Class)GetTypeNodeFor("System", "Exception", ElementType.Class); Attribute = (Class)GetTypeNodeFor("System", "Attribute", ElementType.Class); DBNull = (Class)GetTypeNodeFor("System", "DBNull", ElementType.Class); DateTime = (Struct)GetTypeNodeFor("System", "DateTime", ElementType.ValueType); Decimal = (Struct)GetTypeNodeFor("System", "Decimal", ElementType.ValueType); #endif ArgIterator = (Struct)GetTypeNodeFor("System", "ArgIterator", ElementType.ValueType); IsVolatile = (Class)GetTypeNodeFor("System.Runtime.CompilerServices", "IsVolatile", ElementType.Class); Void = (Struct)GetTypeNodeFor("System", "Void", ElementType.Void); RuntimeFieldHandle = (Struct)GetTypeNodeFor("System", "RuntimeFieldHandle", ElementType.ValueType); RuntimeMethodHandle = (Struct)GetTypeNodeFor("System", "RuntimeMethodHandle", ElementType.ValueType); RuntimeTypeHandle = (Struct)GetTypeNodeFor("System", "RuntimeTypeHandle", ElementType.ValueType); #if !MinimalReader RuntimeArgumentHandle = (Struct)GetTypeNodeFor("System", "RuntimeArgumentHandle", ElementType.ValueType); #endif SecurityAction = GetTypeNodeFor("System.Security.Permissions", "SecurityAction", ElementType.ValueType) as EnumNode; CoreSystemTypes.Initialized = true; CoreSystemTypes.InstantiateGenericInterfaces(); #if !NoWriter Literal.Initialize(); #endif object dummy = TargetPlatform.AssemblyReferenceFor; //Force selection of target platform if (dummy == null) return; }