pub(crate) fn gen_signature(
    db: &impl IrDatabase,
    f: hir::Function,
    module: &Module,
    params: CodeGenParams,
) -> FunctionValue {
    let name = {
        let name = f.name(db).to_string();
        if params.make_marshallable {
            format!("{}_wrapper", name)
        } else {
            name
        }
    };

    if let AnyTypeEnum::FunctionType(ty) = db.type_ir(f.ty(db), params) {
        module.add_function(&name, ty, None)
    } else {
        panic!("not a function type")
    }
}
/// Generates a `FunctionValue` for a `hir::Function`. This function does not generate a body for
/// the `hir::Function`. That task is left to the `gen_body` function. The reason this is split
/// between two functions is that first all signatures are generated and then all bodies. This
/// allows bodies to reference `FunctionValue` wherever they are declared in the file.
Generates a `FunctionValue` for a `hir::Function`. This function does not generate a body for
the `hir::Function`. That task is left to the `gen_body` function. The reason this is split
between two functions is that first all signatures are generated and then all bodies. This
allows bodies to reference `FunctionValue` wherever they are declared in the file.
Generates a ` FunctionValue ` for a ` hir :: Function ` . This function does not generate a body for the ` hir :: Function ` . That task is left to the ` gen_body ` function . The reason this is split between two functions is that first all signatures are generated and then all bodies . This allows bodies to reference ` FunctionValue ` wherever they are declared in the file .
pub(crate) fn gen_signature(
    db: &impl IrDatabase,
    f: hir::Function,
    module: &Module,
    params: CodeGenParams,
) -> FunctionValue {
    let name = {
        let name = f.name(db).to_string();
        if params.make_marshallable {
            format!("{}_wrapper", name)
        } else {
            name
        }
    };
    if let AnyTypeEnum::FunctionType(ty) = db.type_ir(f.ty(db), params) {
        module.add_function(&name, ty, None)
    } else {
        panic!("not a function type")
    }
}
pub ( crate ) fn gen_signature ( db : & impl IrDatabase , f : hir :: Function , module : & Module , params : CodeGenParams , ) -> FunctionValue { let name = { let name = f . name ( db ) . to_string ( ) ; if params . make_marshallable { format ! ( " " name ) } else { name } } ; if let AnyTypeEnum :: FunctionType ( ty ) = db . type_ir ( f . ty ( db ) , params ) { module . add_function ( & name , ty , None ) } else { panic ! ( " " ) } }
Generates a `FunctionValue` for a `hir::Function`.
Generates a ` FunctionValue ` for a ` hir :: Function ` .
db
&impl IrDatabase
f
hir::Function
module
&Module
params
CodeGenParams
db
&impl IrDatabase
f
hir::Function
module
&Module
params
CodeGenParams