Skip to content

Commit 0acd23c

Browse files
committed
Add llvm.type.checked.load intrinsic
Add the intrinsic declare {i8*, i1} @llvm.type.checked.load(i8* %ptr, i32 %offset, metadata %type) This is used in the VFE optimization when lowering loading functions from vtables to LLVM IR. The `metadata` is used to map the function to all vtables this function could belong to. This ensures that functions from vtables that might be used somewhere won't get removed.
1 parent fc70301 commit 0acd23c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/intrinsic/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,16 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
356356
self.context.new_rvalue_from_int(self.int_type, 0)
357357
}
358358

359+
fn type_checked_load(
360+
&mut self,
361+
_llvtable: Self::Value,
362+
_vtable_byte_offset: u64,
363+
_typeid: Self::Value,
364+
) -> Self::Value {
365+
// Unsupported.
366+
self.context.new_rvalue_from_int(self.int_type, 0)
367+
}
368+
359369
fn va_start(&mut self, _va_list: RValue<'gcc>) -> RValue<'gcc> {
360370
unimplemented!();
361371
}

0 commit comments

Comments
 (0)