pub fn empty_function(name: &str, params: &[Type], returns: &[Type]) -> FunctionExpand description
Build an empty Cranelift function with the requested signature.
The returned Function has:
- A
SystemVcalling convention. (The actual CC doesn’t matter for the IR-shape tests these fixtures support — the lowering passes don’t inspect it. SystemV is the workspace default for “any sane CC will do”.) - One entry block whose block-param list matches
params1:1 (same types, same order). - A terminating
returnof zero values. The caller is expected to either accept the empty return (e.g. void-returning functions) or to replace the terminator before lowering when a non-empty return is required. Replacing the terminator is uncommon in the wave-1 tests; most callers either usefunction_with_*(which already inserts a sensible return) or this helper for void fixtures.
The name argument is wrapped via UserFuncName::testcase so it
shows up readably in Function::display() output during test
failures.