Skip to content

Commit f899e39

Browse files
committed
Implemented a few more intrinsics
1 parent 8b64140 commit f899e39

File tree

4 files changed

+318
-53
lines changed

4 files changed

+318
-53
lines changed

cilly/src/cil_node.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,17 @@ impl CILNode {
560560
_ => (),
561561
}
562562
}
563-
563+
pub fn transmute_on_stack(self, src: Type, target: Type) -> Self {
564+
let tmp_loc = Self::TemporaryLocal(Box::new((
565+
src,
566+
Box::new([CILRoot::SetTMPLocal { value: self }]),
567+
CILNode::LoadAddresOfTMPLocal,
568+
)));
569+
Self::LdObj {
570+
ptr: Box::new(crate::conv_usize!(tmp_loc).cast_ptr(ptr!(target.clone()))),
571+
obj: Box::new(target),
572+
}
573+
}
564574
pub fn cast_ptr(self, new_ptr: Type) -> Self {
565575
assert!(
566576
matches!(

0 commit comments

Comments
 (0)