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.
This commit is contained in:
parent
d55787a155
commit
e1c1d0f8c2
6 changed files with 88 additions and 18 deletions
|
@ -22,6 +22,14 @@ pub trait IntrinsicCallMethods<'tcx>: BackendTypes {
|
|||
fn expect(&mut self, cond: Self::Value, expected: bool) -> Self::Value;
|
||||
/// Trait method used to test whether a given pointer is associated with a type identifier.
|
||||
fn type_test(&mut self, pointer: Self::Value, typeid: Self::Value) -> Self::Value;
|
||||
/// Trait method used to load a function while testing if it is associated with a type
|
||||
/// identifier.
|
||||
fn type_checked_load(
|
||||
&mut self,
|
||||
llvtable: Self::Value,
|
||||
vtable_byte_offset: u64,
|
||||
typeid: Self::Value,
|
||||
) -> Self::Value;
|
||||
/// Trait method used to inject `va_start` on the "spoofed" `VaListImpl` in
|
||||
/// Rust defined C-variadic functions.
|
||||
fn va_start(&mut self, val: Self::Value) -> Self::Value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue