fn gen_fn<'ll, 'tcx>(
    cx: &CodegenCx<'ll, 'tcx>,
    name: &str,
    inputs: Vec<Ty<'tcx>>,
    output: Ty<'tcx>,
    codegen: &mut dyn FnMut(Builder<'_, 'll, 'tcx>),
) -> &'ll Value {
    let rust_fn_ty = cx.tcx.mk_fn_ptr(ty::Binder::bind(cx.tcx.mk_fn_sig(
        inputs.into_iter(),
        output,
        false,
        hir::Unsafety::Unsafe,
        Abi::Rust
    )));
    let llfn = declare::define_internal_fn(cx, name, rust_fn_ty);
    attributes::from_fn_attrs(cx, llfn, None);
    let bx = Builder::new_block(cx, llfn, "entry-block");
    codegen(bx);
    llfn
}
// Helper function to give a Block to a closure to codegen a shim function.
// This is currently primarily used for the `try` intrinsic functions above.
Helper function to give a Block to a closure to codegen a shim function.
This is currently primarily used for the `try` intrinsic functions above.
Helper function to give a Block to a closure to codegen a shim function . This is currently primarily used for the ` try ` intrinsic functions above .
fn gen_fn<'ll, 'tcx>(
    cx: &CodegenCx<'ll, 'tcx>,
    name: &str,
    inputs: Vec<Ty<'tcx>>,
    output: Ty<'tcx>,
    codegen: &mut dyn FnMut(Builder<'_, 'll, 'tcx>),
) -> &'ll Value {
    let rust_fn_ty = cx.tcx.mk_fn_ptr(ty::Binder::bind(cx.tcx.mk_fn_sig(
        inputs.into_iter(),
        output,
        false,
        hir::Unsafety::Unsafe,
        Abi::Rust
    )));
    let llfn = declare::define_internal_fn(cx, name, rust_fn_ty);
    attributes::from_fn_attrs(cx, llfn, None);
    let bx = Builder::new_block(cx, llfn, "entry-block");
    codegen(bx);
    llfn
}
fn gen_fn < ' ll , ' tcx > ( cx : & CodegenCx < ' ll , ' tcx > , name : & str , inputs : Vec < Ty < ' tcx > > , output : Ty < ' tcx > , codegen : & mut dyn FnMut ( Builder < ' _ , ' ll , ' tcx > ) , ) -> & ' ll Value { let rust_fn_ty = cx . tcx . mk_fn_ptr ( ty :: Binder :: bind ( cx . tcx . mk_fn_sig ( inputs . into_iter ( ) , output , false , hir :: Unsafety :: Unsafe , Abi :: Rust ) ) ) ; let llfn = declare :: define_internal_fn ( cx , name , rust_fn_ty ) ; attributes :: from_fn_attrs ( cx , llfn , None ) ; let bx = Builder :: new_block ( cx , llfn , " " ) ; codegen ( bx ) ; llfn }
Helper function to give a Block to a closure to codegen a shim function.
Helper function to give a Block to a closure to codegen a shim function .
cx
&CodegenCx<'ll, 'tcx>
name
&str
inputs
Vec<Ty<'tcx>>
output
Ty<'tcx>
codegen
&mut dyn FnMut(Builder<'_, 'll, 'tcx>)
cx
&CodegenCx<'ll, 'tcx>
name
&str
inputs
Vec<Ty<'tcx>>
output
Ty<'tcx>
codegen
&mut dyn FnMut(Builder<'_, 'll, 'tcx>)