add MorphismInstance::Id
This commit is contained in:
parent
edd3441511
commit
cff14cf096
2 changed files with 11 additions and 1 deletions
src/c_gen
|
@ -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()))
|
||||
);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue