Beispiel #1
0
        void ProcessMethod(MethodDefinition method)
        {
            if (method.IsPInvokeImpl && method.HasPInvokeInfo && method.PInvokeInfo != null)
            {
                var pinfo = method.PInvokeInfo;

                if (state != null)
                {
                    switch (pinfo.EntryPoint)
                    {
                    case "objc_msgSend":
                    case "objc_msgSendSuper":
                    case "objc_msgSend_stret":
                    case "objc_msgSendSuper_stret":
                    case "objc_msgSend_fpret":
                        state.ProcessMethod(method);
                        break;

                    default:
                        break;
                    }
                }

                switch (pinfo.Module.Name)
                {
                case "__Internal":
                    DerivedLinkContext.RequiredSymbols.AddFunction(pinfo.EntryPoint).AddMember(method);
                    break;

                case "System.Native":
                case "System.Security.Cryptography.Native.Apple":
                    DerivedLinkContext.RequireMonoNative = true;
                    DerivedLinkContext.RequiredSymbols.AddFunction(pinfo.EntryPoint).AddMember(method);
                    break;

                case "System.Net.Security.Native":
                    DerivedLinkContext.RequireGss        = true;
                    DerivedLinkContext.RequireMonoNative = true;
                    DerivedLinkContext.RequiredSymbols.AddFunction(pinfo.EntryPoint).AddMember(method);
                    break;
                }
            }

            if (MarkStep.IsPropertyMethod(method))
            {
                var    property = MarkStep.GetProperty(method);
                object symbol;
                // The Field attribute may have been linked away, but we've stored it in an annotation.
                if (property != null && Context.Annotations.GetCustomAnnotations("ExportedFields").TryGetValue(property, out symbol))
                {
                    DerivedLinkContext.RequiredSymbols.AddField((string)symbol).AddMember(property);
                }
            }
        }
        void ProcessMethod(MethodDefinition method)
        {
            if (method.IsPInvokeImpl && method.HasPInvokeInfo && method.PInvokeInfo.Module.Name == "__Internal")
            {
                ((DerivedLinkContext)Context).RequiredSymbols[method.PInvokeInfo.EntryPoint] = method;
            }

            if (MarkStep.IsPropertyMethod(method))
            {
                var    property = MarkStep.GetProperty(method);
                object symbol;
                // The Field attribute may have been linked away, but we've stored it in an annotation.
                if (property != null && Context.Annotations.GetCustomAnnotations("ExportedFields").TryGetValue(property, out symbol))
                {
                    ((DerivedLinkContext)Context).RequiredSymbols[(string)symbol] = property;
                }
            }
        }
        void ProcessMethod(MethodDefinition method)
        {
            if (method.IsPInvokeImpl && method.HasPInvokeInfo)
            {
                var pinfo = method.PInvokeInfo;
                if (pinfo.Module.Name == "__Internal")
                {
                    DerivedLinkContext.GetRequiredSymbolList(pinfo.EntryPoint).Add(method);
                }

                if (state != null)
                {
                    switch (pinfo.EntryPoint)
                    {
                    case "objc_msgSend":
                    case "objc_msgSendSuper":
                    case "objc_msgSend_stret":
                    case "objc_msgSendSuper_stret":
                    case "objc_msgSend_fpret":
                        state.ProcessMethod(method);
                        break;

                    default:
                        return;
                    }
                }
            }

            if (MarkStep.IsPropertyMethod(method))
            {
                var    property = MarkStep.GetProperty(method);
                object symbol;
                // The Field attribute may have been linked away, but we've stored it in an annotation.
                if (property != null && Context.Annotations.GetCustomAnnotations("ExportedFields").TryGetValue(property, out symbol))
                {
                    DerivedLinkContext.GetRequiredSymbolList((string)symbol).Add(property);
                }
            }
        }