Esempio n. 1
0
 public IRLocal(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
Esempio n. 2
0
 public IRParameter(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
Esempio n. 3
0
 public IRLocal(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
Esempio n. 4
0
 private void AddAssembly(IRAssembly pAssembly)
 {
     Assemblies.Add(pAssembly);
     AssemblyFileLookup.Add(pAssembly.File, pAssembly);
     AssemblyFileReferenceNameLookup.Add(pAssembly.File.ReferenceName, pAssembly);
 }
Esempio n. 5
0
 public IRType(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
Esempio n. 6
0
        internal void CacheCORTypes(IRAssembly pAssembly)
        {
            foreach (IRType type in pAssembly.Types)
            {
                if (type.Namespace == "System")
                {
                    switch (type.Name)
                    {
                    case "Array": System_Array = type; break;

                    case "Boolean": System_Boolean = type; break;

                    case "Byte": System_Byte = type; break;

                    case "Char": System_Char = type; break;

                    case "Double": System_Double = type; break;

                    case "Enum": System_Enum = type; break;

                    case "Exception": System_Exception = type; break;

                    case "Int16": System_Int16 = type; break;

                    case "Int32": System_Int32 = type; break;

                    case "Int64": System_Int64 = type; break;

                    case "IntPtr": System_IntPtr = type; break;

                    case "Object": System_Object = type; break;

                    case "RuntimeFieldHandle": System_RuntimeFieldHandle = type; break;

                    case "RuntimeMethodHandle": System_RuntimeMethodHandle = type; break;

                    case "RuntimeTypeHandle": System_RuntimeTypeHandle = type; break;

                    case "SByte": System_SByte = type; break;

                    case "Single": System_Single = type; break;

                    case "String": System_String = type; break;

                    case "Type": System_Type = type; break;

                    case "TypedReference": System_TypedReference = type; break;

                    case "UInt16": System_UInt16 = type; break;

                    case "UInt32": System_UInt32 = type; break;

                    case "UInt64": System_UInt64 = type; break;

                    case "UIntPtr": System_UIntPtr = type; break;

                    case "ValueType": System_ValueType = type; break;

                    case "Void": System_Void = type; break;

                    default: break;
                    }
                }
            }
        }
Esempio n. 7
0
        public IRType PresolveType(TypeRefData pTypeRefData)
        {
            if (pTypeRefData.ExportedType != null)
            {
                switch (pTypeRefData.ExportedType.Implementation.Type)
                {
                case ImplementationIndex.ImplementationType.File:
                {
                    IRAssembly assembly = null;
                    if (!AssemblyFileReferenceNameLookup.TryGetValue(pTypeRefData.ExportedType.Implementation.File.Name, out assembly))
                    {
                        throw new KeyNotFoundException();
                    }
                    IRType type = assembly.Types.Find(t => t.Namespace == pTypeRefData.TypeNamespace && t.Name == pTypeRefData.TypeName);
                    if (type == null)
                    {
                        throw new NullReferenceException();
                    }
                    return(type);
                }

                case ImplementationIndex.ImplementationType.AssemblyRef:
                {
                    IRAssembly assembly = null;
                    if (!AssemblyFileReferenceNameLookup.TryGetValue(pTypeRefData.ExportedType.Implementation.AssemblyRef.Name, out assembly))
                    {
                        throw new KeyNotFoundException();
                    }
                    IRType type = assembly.Types.Find(t => t.Namespace == pTypeRefData.TypeNamespace && t.Name == pTypeRefData.TypeName);
                    if (type == null)
                    {
                        throw new NullReferenceException();
                    }
                    return(type);
                }

                default: break;
                }
                throw new NullReferenceException();
            }
            switch (pTypeRefData.ResolutionScope.Type)
            {
            case ResolutionScopeIndex.ResolutionScopeType.AssemblyRef:
            {
                IRAssembly assembly = null;
                if (!AssemblyFileReferenceNameLookup.TryGetValue(pTypeRefData.ResolutionScope.AssemblyRef.Name, out assembly))
                {
                    throw new KeyNotFoundException();
                }
                IRType type = assembly.Types.Find(t => t.Namespace == pTypeRefData.TypeNamespace && t.Name == pTypeRefData.TypeName);
                if (type == null)
                {
                    throw new NullReferenceException();
                }
                return(type);
            }

            case ResolutionScopeIndex.ResolutionScopeType.TypeRef:
            {
                IRType type = PresolveType(pTypeRefData.ResolutionScope.TypeRef);
                if (type == null)
                {
                    throw new NullReferenceException();
                }
                type = type.NestedTypes.Find(t => t.Namespace == pTypeRefData.TypeNamespace && t.Name == pTypeRefData.TypeName);
                if (type == null)
                {
                    throw new NullReferenceException();
                }
                return(type);
            }
            }
            throw new NullReferenceException();
        }
 public IRInterfaceImplementation(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
Esempio n. 9
0
 public IRField(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
Esempio n. 10
0
 public IRField(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
Esempio n. 11
0
 public IRMethod(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
Esempio n. 12
0
 public IRMethod(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
Esempio n. 13
0
 public IRParameter(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
Esempio n. 14
0
 public IRType(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }