aboutsummaryrefslogtreecommitdiff
path: root/patio-to-cranelift/src/patio/flatbuffers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'patio-to-cranelift/src/patio/flatbuffers.rs')
-rw-r--r--patio-to-cranelift/src/patio/flatbuffers.rs22
1 files changed, 19 insertions, 3 deletions
diff --git a/patio-to-cranelift/src/patio/flatbuffers.rs b/patio-to-cranelift/src/patio/flatbuffers.rs
index 900a2c4c..34e0a1a1 100644
--- a/patio-to-cranelift/src/patio/flatbuffers.rs
+++ b/patio-to-cranelift/src/patio/flatbuffers.rs
@@ -9,9 +9,9 @@ use crate::{
instructions::{
PatioBlock, PatioBoolToInt, PatioCall, PatioCallPointer, PatioDataPtrToInt, PatioIf,
PatioInstruction, PatioIntAdd, PatioIntEquals, PatioIntNotEqual, PatioIntSub,
- PatioIntToBool, PatioIntToDataPtr, PatioLocalStore, PatioMemoryLoad, PatioMemoryStore,
- PatioResume, PatioReturn, PatioReturnVoid, PatioSwitch, PatioSwitchCase, PatioVarLoad,
- PatioVarStore,
+ PatioIntToBool, PatioIntToDataPtr, PatioLocalStore, PatioLoop, PatioLoopBreak,
+ PatioLoopContinue, PatioMemoryLoad, PatioMemoryStore, PatioResume, PatioReturn,
+ PatioReturnVoid, PatioSwitch, PatioSwitchCase, PatioVarLoad, PatioVarStore,
},
operands::{PatioLocalRef, PatioOperand},
types::{PatioDataLayout, PatioType},
@@ -272,6 +272,22 @@ impl From<patio_generated::patio::PatioInstruction<'_>> for PatioInstruction {
})
}
+ patio_generated::patio::PatioInstructionValue::PatioLoop => {
+ let loop_ = value.value_as_patio_loop().unwrap();
+
+ Self::Loop(PatioLoop {
+ body: loop_.body().iter().map(Into::into).collect(),
+ })
+ }
+
+ patio_generated::patio::PatioInstructionValue::PatioLoopBreak => {
+ Self::LoopBreak(PatioLoopBreak)
+ }
+
+ patio_generated::patio::PatioInstructionValue::PatioLoopContinue => {
+ Self::LoopContinue(PatioLoopContinue)
+ }
+
patio_generated::patio::PatioInstructionValue::PatioMemoryLoad => {
let memory_load = value.value_as_patio_memory_load().unwrap();