示例#1
0
 static int get_object_pushtype(Opcode n, target.Target t)
 {
     return(ct_intptr);
 }
示例#2
0
        static int get_binnumop_pushtype(Opcode n, target.Target t)
        {
            var a = n.uses[0].ct;
            var b = n.uses[1].ct;

            switch (a)
            {
            case ct_int32:
                switch (b)
                {
                case ct_int32:
                    return(ct_int32);

                case ct_intptr:
                    return(ct_intptr);

                case ct_ref:
                    if (n.oc == oc_add)
                    {
                        return(ct_ref);
                    }
                    break;
                }
                break;

            case ct_int64:
                switch (b)
                {
                case ct_int64:
                    return(ct_int64);
                }
                break;

            case ct_intptr:
                switch (b)
                {
                case ct_int32:
                    return(ct_intptr);

                case ct_intptr:
                    return(ct_intptr);

                case ct_ref:
                    if (n.oc == oc_add)
                    {
                        return(ct_ref);
                    }
                    break;
                }
                break;

            case ct_float:
                switch (b)
                {
                case ct_float:
                    return(ct_float);
                }
                break;

            case ct_ref:
                switch (b)
                {
                case ct_int32:
                    if (n.oc == oc_add || n.oc == oc_sub)
                    {
                        return(ct_ref);
                    }
                    break;

                case ct_intptr:
                    if (n.oc == oc_add || n.oc == oc_sub)
                    {
                        return(ct_ref);
                    }
                    break;

                case ct_ref:
                    if (n.oc == oc_sub)
                    {
                        return(ct_intptr);
                    }
                    break;
                }
                break;
            }
            throw new NotSupportedException("Invalid opcode:" + n.ToString());
        }