Separate the IR evaluator, add an interesting stack-breaking case.

This commit is contained in:
2024-04-18 12:33:34 -07:00
parent 7d4f182a67
commit 6800064bdf
16 changed files with 283 additions and 122 deletions

View File

@@ -500,7 +500,7 @@ impl<M: Module> Backend<M> {
.into_iter()
.unzip();
match *function {
match function {
ValueOrRef::Value(_, _, _) => {
panic!("Can't use a value for a function")
}
@@ -568,10 +568,7 @@ impl<M: Module> Backend<M> {
Primitive::Negate => {
assert_eq!(1, arguments.len());
Ok((
builder.ins().ineg(arguments[0]),
argument_types[0],
))
Ok((builder.ins().ineg(arguments[0]), argument_types[0]))
}
Primitive::Print => {