コード例 #1
0
ファイル: IRLocal.cs プロジェクト: Astaelan/Fusion
 public IRLocal(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
コード例 #2
0
ファイル: IRParameter.cs プロジェクト: Astaelan/Fusion
 public IRParameter(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
コード例 #3
0
ファイル: IRLocal.cs プロジェクト: Astaelan/Fusion
 public IRLocal(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
コード例 #4
0
 private void AddAssembly(IRAssembly pAssembly)
 {
     Assemblies.Add(pAssembly);
     AssemblyFileLookup.Add(pAssembly.File, pAssembly);
     AssemblyFileReferenceNameLookup.Add(pAssembly.File.ReferenceName, pAssembly);
 }
コード例 #5
0
ファイル: IRType.cs プロジェクト: Astaelan/Fusion
 public IRType(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
コード例 #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;
                    }
                }
            }
        }
コード例 #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();
        }
コード例 #8
0
 public IRInterfaceImplementation(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
コード例 #9
0
 public IRField(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
コード例 #10
0
ファイル: IRField.cs プロジェクト: Astaelan/Fusion
 public IRField(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
コード例 #11
0
 public IRMethod(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
コード例 #12
0
ファイル: IRMethod.cs プロジェクト: Astaelan/Fusion
 public IRMethod(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
コード例 #13
0
 public IRParameter(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }
コード例 #14
0
ファイル: IRType.cs プロジェクト: Astaelan/Fusion
 public IRType(IRAssembly pAssembly)
 {
     Assembly = pAssembly;
 }