add MorphismInstance::Id

This commit is contained in:
Michael Sippel 2025-05-28 17:33:22 +02:00
parent edd3441511
commit cff14cf096
Signed by: senvas
GPG key ID: F96CF119C34B64A6
2 changed files with 11 additions and 1 deletions

View file

@ -33,7 +33,8 @@ pub fn generate_lib(
}
c_source.push_str(
&format!(r#"FUSE( {}, (void const*)bufIn, (void*)bufOut );\n"#,
&format!(r#"FUSE( {}, (void const*)bufIn, (void*)bufOut );
"#,
inst.instantiated_symbol_name(dict, &HashMap::new()))
);

View file

@ -162,6 +162,15 @@ impl LdmcCTargetMorph {
let symbol = encode_morph_type_to_symbol(dict, &ty);
match &morph_inst {
MorphismInstance::Id { ψ } => {
self.add_required_header_block("#include <string.h>".into());
Ok(LdmcPrimMorph {
symbol,
type_args: Vec::new(),
ty: MorphismType { src_type: ψ.clone(), dst_type: ψ.clone() },
c_source: String::from("memcpy(dst, src, sizeof(*src));")
})
}
MorphismInstance::Primitive { ψ, σ, morph } => {
if let Some(i) = self.header_dependencies.get(&morph.get_type()) {
self.active_headers.push(*i);