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.rs26
1 files changed, 22 insertions, 4 deletions
diff --git a/patio-to-cranelift/src/patio/flatbuffers.rs b/patio-to-cranelift/src/patio/flatbuffers.rs
index c219d823..ad667963 100644
--- a/patio-to-cranelift/src/patio/flatbuffers.rs
+++ b/patio-to-cranelift/src/patio/flatbuffers.rs
@@ -6,10 +6,10 @@ use crate::{
PatioLocal, PatioLocalType, PatioVisibility,
},
instructions::{
- PatioBlock, PatioBoolToInt, PatioCall, PatioCallPointer, PatioIf, PatioInstruction,
- PatioIntAdd, PatioIntEquals, PatioIntNotEqual, PatioIntSub, PatioIntToBool,
- PatioLocalStore, PatioMemoryLoad, PatioMemoryStore, PatioResume, PatioReturn,
- PatioReturnVoid, PatioVarLoad, PatioVarStore,
+ PatioBlock, PatioBoolToInt, PatioCall, PatioCallPointer, PatioDataPtrToInt, PatioIf,
+ PatioInstruction, PatioIntAdd, PatioIntEquals, PatioIntNotEqual, PatioIntSub,
+ PatioIntToBool, PatioIntToDataPtr, PatioLocalStore, PatioMemoryLoad, PatioMemoryStore,
+ PatioResume, PatioReturn, PatioReturnVoid, PatioVarLoad, PatioVarStore,
},
operands::{PatioLocalRef, PatioOperand},
types::{PatioDataLayout, PatioType},
@@ -174,6 +174,15 @@ impl From<patio_generated::patio::PatioInstruction<'_>> for PatioInstruction {
})
}
+ patio_generated::patio::PatioInstructionValue::PatioDataPtrToInt => {
+ let data_ptr_to_int = value.value_as_patio_data_ptr_to_int().unwrap();
+
+ Self::DataPtrToInt(PatioDataPtrToInt {
+ destination: data_ptr_to_int.destination().into(),
+ value: data_ptr_to_int.value().into(),
+ })
+ }
+
patio_generated::patio::PatioInstructionValue::PatioIf => {
let if_ = value.value_as_patio_if().unwrap();
@@ -234,6 +243,15 @@ impl From<patio_generated::patio::PatioInstruction<'_>> for PatioInstruction {
})
}
+ patio_generated::patio::PatioInstructionValue::PatioIntToDataPtr => {
+ let int_to_data_ptr = value.value_as_patio_int_to_data_ptr().unwrap();
+
+ Self::IntToDataPtr(PatioIntToDataPtr {
+ destination: int_to_data_ptr.destination().into(),
+ value: int_to_data_ptr.value().into(),
+ })
+ }
+
patio_generated::patio::PatioInstructionValue::PatioLocalStore => {
let local_store = value.value_as_patio_local_store().unwrap();