pub fn reify<'a>(self, ccx: &CrateContext<'a, 'tcx>) -> ValueRef {
        match self.data {
            Fn(llfn) => llfn,
            Virtual(_) => meth::trans_object_shim(ccx, self),
            NamedTupleConstructor(disr) => match self.ty.sty {
                ty::TyFnDef(def_id, substs, _) => {
                    let instance = Instance::new(def_id, substs);
                    if let Some(&llfn) = ccx.instances().borrow().get(&instance) {
                        return llfn;
                    }

                    let sym = ccx.symbol_map().get_or_compute(ccx.shared(),
                                                              TransItem::Fn(instance));
                    assert!(!ccx.codegen_unit().contains_item(&TransItem::Fn(instance)));
                    let lldecl = declare::define_internal_fn(ccx, &sym, self.ty);
                    base::trans_ctor_shim(ccx, def_id, substs, disr, lldecl);
                    ccx.instances().borrow_mut().insert(instance, lldecl);

                    lldecl
                }
                _ => bug!("expected fn item type, found {}", self.ty)
            },
            Intrinsic => bug!("intrinsic {} getting reified", self.ty)
        }
    }
/// Turn the callee into a function pointer.
Turn the callee into a function pointer.
Turn the callee into a function pointer .
pub fn reify<'a>(self, ccx: &CrateContext<'a, 'tcx>) -> ValueRef {
        match self.data {
            Fn(llfn) => llfn,
            Virtual(_) => meth::trans_object_shim(ccx, self),
            NamedTupleConstructor(disr) => match self.ty.sty {
                ty::TyFnDef(def_id, substs, _) => {
                    let instance = Instance::new(def_id, substs);
                    if let Some(&llfn) = ccx.instances().borrow().get(&instance) {
                        return llfn;
                    }
                    let sym = ccx.symbol_map().get_or_compute(ccx.shared(),
                                                              TransItem::Fn(instance));
                    assert!(!ccx.codegen_unit().contains_item(&TransItem::Fn(instance)));
                    let lldecl = declare::define_internal_fn(ccx, &sym, self.ty);
                    base::trans_ctor_shim(ccx, def_id, substs, disr, lldecl);
                    ccx.instances().borrow_mut().insert(instance, lldecl);
                    lldecl
                }
                _ => bug!("expected fn item type, found {}", self.ty)
            },
            Intrinsic => bug!("intrinsic {} getting reified", self.ty)
        }
    }
pub fn reify < ' a > ( self , ccx : & CrateContext < ' a , ' tcx > ) -> ValueRef { match self . data { Fn ( llfn ) => llfn , Virtual ( _ ) => meth :: trans_object_shim ( ccx , self ) , NamedTupleConstructor ( disr ) => match self . ty . sty { ty :: TyFnDef ( def_id , substs , _ ) => { let instance = Instance :: new ( def_id , substs ) ; if let Some ( & llfn ) = ccx . instances ( ) . borrow ( ) . get ( & instance ) { return llfn ; } let sym = ccx . symbol_map ( ) . get_or_compute ( ccx . shared ( ) , TransItem :: Fn ( instance ) ) ; assert ! ( ccx codegen_unit ( ) contains_item ( TransItem Fn ( instance ) ) ) ; let lldecl = declare :: define_internal_fn ( ccx , & sym , self . ty ) ; base :: trans_ctor_shim ( ccx , def_id , substs , disr , lldecl ) ; ccx . instances ( ) . borrow_mut ( ) . insert ( instance , lldecl ) ; lldecl } _ => bug ! ( " " self ty ) } , Intrinsic => bug ! ( " " self ty ) } }
Turn the callee into a function pointer.
Turn the callee into a function pointer .
self
ccx
&CrateContext<'a, 'tcx>
self
ccx
&CrateContext<'a, 'tcx>