Exemplo n.º 1
0
                public GenericMethodRef GetGenericMethodRef (GenericArguments gen_args)
                {
                        GenericMethodRef methref = null;

                        if (gen_method_table == null)
                                gen_method_table = new Hashtable ();
                        else
                                methref = (GenericMethodRef) gen_method_table [gen_args.ToString ()];

                        if (methref == null) {
                                methref = new GenericMethodRef (this, GenericMethodSig.GetInstance (gen_args));
                                gen_method_table [gen_args.ToString ()] = methref;
                        }

                        return methref;
                }
Exemplo n.º 2
0
        public virtual PEAPI.Type ResolveInstance(CodeGen code_gen, GenericArguments gen_args)
        {
            PEAPI.GenericTypeInst gtri = null;
            string sig = gen_args.ToString();

            if (p_genericinst_table == null)
            {
                p_genericinst_table = new Hashtable();
            }
            else
            {
                gtri = p_genericinst_table [sig] as PEAPI.GenericTypeInst;
            }

            if (gtri == null)
            {
                if (!IsResolved)
                {
                    Resolve(code_gen);
                }

                gtri = new PEAPI.GenericTypeInst(PeapiType, gen_args.Resolve(code_gen));
                p_genericinst_table [sig] = gtri;
            }

            return(gtri);
        }
Exemplo n.º 3
0
                public static GenericMethodSig GetInstance (GenericArguments gen_args)
                {
                        GenericMethodSig sig = null;

                        if (sig_table == null)
                                sig_table = new Hashtable ();
                        else
                                sig = (GenericMethodSig) sig_table [gen_args.ToString ()];

                        if (sig == null) {
                                sig = new GenericMethodSig (gen_args);
                                sig_table [gen_args.ToString ()] = sig;
                        }
                        
                        return sig;
                }
Exemplo n.º 4
0
        public static GenericMethodSig GetInstance(GenericArguments gen_args)
        {
            GenericMethodSig sig = null;

            if (sig_table == null)
            {
                sig_table = new Hashtable();
            }
            else
            {
                sig = (GenericMethodSig)sig_table [gen_args.ToString()];
            }

            if (sig == null)
            {
                sig = new GenericMethodSig(gen_args);
                sig_table [gen_args.ToString()] = sig;
            }

            return(sig);
        }
Exemplo n.º 5
0
        public GenericMethodRef GetGenericMethodRef(GenericArguments gen_args)
        {
            GenericMethodRef methref = null;

            if (gen_method_table == null)
            {
                gen_method_table = new Hashtable();
            }
            else
            {
                methref = (GenericMethodRef)gen_method_table [gen_args.ToString()];
            }

            if (methref == null)
            {
                methref = new GenericMethodRef(this, GenericMethodSig.GetInstance(gen_args));
                gen_method_table [gen_args.ToString()] = methref;
            }

            return(methref);
        }
Exemplo n.º 6
0
                public GenericTypeInst (BaseClassRef class_ref, GenericArguments gen_args, bool is_valuetypeinst,
                                string sig_mod, ArrayList conv_list)
                        : base ("", is_valuetypeinst, conv_list, sig_mod)
                {
                        if (class_ref is GenericTypeInst)
                                throw new InternalErrorException ("Cannot create nested GenericInst, '" +
                                                        class_ref.FullName + "' '" + gen_args.ToString () + "'");

                        this.class_ref = class_ref;
                        this.gen_args = gen_args;
                        is_added = false;
                }
Exemplo n.º 7
0
        public GenericTypeInst(BaseClassRef class_ref, GenericArguments gen_args, bool is_valuetypeinst,
                               string sig_mod, ArrayList conv_list)
            : base("", is_valuetypeinst, conv_list, sig_mod)
        {
            if (class_ref is GenericTypeInst)
            {
                throw new InternalErrorException("Cannot create nested GenericInst, '" +
                                                 class_ref.FullName + "' '" + gen_args.ToString() + "'");
            }

            this.class_ref = class_ref;
            this.gen_args  = gen_args;
            is_added       = false;
        }
Exemplo n.º 8
0
                public virtual PEAPI.Type ResolveInstance (CodeGen code_gen, GenericArguments gen_args)
                {
                        PEAPI.GenericTypeInst gtri = null;
                        string sig = gen_args.ToString ();

                        if (p_genericinst_table == null)
                                p_genericinst_table = new Hashtable ();
                        else
                                gtri = p_genericinst_table [sig] as PEAPI.GenericTypeInst;

                        if (gtri == null) {
                                if (!IsResolved)
                                        Resolve (code_gen);

                                gtri = new PEAPI.GenericTypeInst (PeapiType, gen_args.Resolve (code_gen));
                                p_genericinst_table [sig] = gtri;
                        }
                        
                        return gtri;
                }
Exemplo n.º 9
0
 public override PEAPI.Type ResolveInstance(CodeGen code_gen, GenericArguments gen_args)
 {
     Report.Error("Invalid attempt to create '" + FullName + "''" + gen_args.ToString() + "'");
     return(null);
 }
Exemplo n.º 10
0
 public override GenericTypeInst GetGenericTypeInst(GenericArguments gen_args)
 {
     Report.Error("Invalid attempt to create '" + FullName + "''" + gen_args.ToString() + "'");
     return(null);
 }
Exemplo n.º 11
0
 public override PEAPI.Type ResolveInstance (CodeGen code_gen, GenericArguments gen_args)
 {
         Report.Error ("Invalid attempt to create '" + FullName + "''" + gen_args.ToString () + "'");
         return null;
 }
Exemplo n.º 12
0
 public override GenericTypeInst GetGenericTypeInst (GenericArguments gen_args)
 {
         Report.Error ("Invalid attempt to create '" + FullName + "''" + gen_args.ToString () + "'");
         return null;
 }