fuse results of sub- morphisms in complex morphisms
This commit is contained in:
parent
35b747ea15
commit
98592aa596
1 changed files with 5 additions and 3 deletions
|
@ -67,6 +67,7 @@ impl LdmcCTargetMorph {
|
|||
LdmcCTargetMorph {
|
||||
includes: vec![
|
||||
"#include <stdint.h>".into(),
|
||||
"#define FUSE(x) { int result = x; if(result) return result; }".into()
|
||||
],
|
||||
active_instantiations: Vec::new(),
|
||||
active_types: Vec::new(),
|
||||
|
@ -98,6 +99,7 @@ impl LdmcCTargetMorph {
|
|||
let mut source = String::new();
|
||||
for inc in self.includes {
|
||||
source.push_str(&inc);
|
||||
source.push('\n');
|
||||
}
|
||||
|
||||
for ty in self.active_types {
|
||||
|
@ -175,7 +177,7 @@ impl LdmcCTargetMorph {
|
|||
{{
|
||||
{} const * restrict src = {};
|
||||
{} * restrict dst = {};
|
||||
{} ( src, dst );
|
||||
FUSE( {} ( src, dst ) );
|
||||
}}"#,
|
||||
src_c_type, src_buf,
|
||||
dst_c_type, dst_buf,
|
||||
|
@ -224,7 +226,7 @@ impl LdmcCTargetMorph {
|
|||
{{
|
||||
{} const * restrict src = (void*) {};
|
||||
{} * restrict dst = (void*) {};
|
||||
{} ( {}, src, dst );
|
||||
FUSE( {} ( {}, src, dst );
|
||||
}}"#,
|
||||
src_c_type, src_buf,
|
||||
dst_c_type, dst_buf,
|
||||
|
@ -256,7 +258,7 @@ impl LdmcCTargetMorph {
|
|||
let name = name.replace("-", "_").replace(".","_dot_");
|
||||
c_source.push_str(
|
||||
&format!("
|
||||
{} ( &src->{}, &dst->{} );
|
||||
FUSE( {} ( &src->{}, &dst->{} ) );
|
||||
",
|
||||
inst.symbol,
|
||||
name, name
|
||||
|
|
Loading…
Add table
Reference in a new issue