[spv-out] implement discard

This commit is contained in:
Lain-dono authored and Dzmitry Malyshau committed 2021-02-15 21:26:29 -05:00
1 parent 3c2843fa63
commit f2d624944c
2 files changed
+7

No files matched your search

+4
View File
@@ -707,6 +707,10 @@ pub(super) fn instruction_branch_conditional(
instruction
}
pub(super) fn instruction_kill() -> Instruction {
Instruction::new(Op::Kill)
}
pub(super) fn instruction_return() -> Instruction {
Instruction::new(Op::Return)
}
+3
View File
@@ -2339,6 +2339,9 @@ impl Writer {
crate::Statement::Return { value: None } => {
block.termination = Some(super::instructions::instruction_return());
}
crate::Statement::Kill => {
block.termination = Some(super::instructions::instruction_kill());
}
crate::Statement::Store { pointer, value } => {
let (pointer_id, _, _) = self.write_expression_pointer(
ir_module,