simplify systemv argument storing and loading

This commit is contained in:
Folkert 2023-02-12 02:08:02 +01:00
parent 89201676ef
commit b968122bee
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
5 changed files with 254 additions and 168 deletions

View file

@ -1056,13 +1056,23 @@ trait Backend<'a> {
self.free_symbol(&Symbol::DEV_TMP)
}
Symbol::STR_IS_VALID_SCALAR => {
// just call the function
let layout_id = LayoutIds::default().get(func_sym, ret_layout);
let fn_name = self.symbol_to_string(func_sym, layout_id);
// Now that the arguments are needed, load them if they are literals.
self.load_literal_symbols(args);
self.build_fn_call(sym, fn_name, args, arg_layouts, ret_layout)
}
other => {
eprintln!("maybe {other:?} should have a custom implementation?");
// just call the function
let layout_id = LayoutIds::default().get(func_sym, ret_layout);
let fn_name = self.symbol_to_string(func_sym, layout_id);
// Now that the arguments are needed, load them if they are literals.
self.load_literal_symbols(args);
self.build_fn_call(sym, fn_name, args, arg_layouts, ret_layout)
}
_ => todo!("the function, {:?}", func_sym),
}
}