1
Fork 0

replace some deprecated functions

This commit is contained in:
Luv-Ray 2024-09-19 09:39:28 +08:00
parent a5cf8bbd4e
commit b7c5656713
14 changed files with 61 additions and 87 deletions

View file

@ -21,6 +21,7 @@ use crate::{CodegenResults, ModuleCodegen};
pub trait BackendTypes {
type Value: CodegenObject;
type Metadata: CodegenObject;
type Function: CodegenObject;
type BasicBlock: Copy;

View file

@ -51,6 +51,7 @@ pub trait BuilderMethods<'a, 'tcx>:
type CodegenCx: CodegenMethods<
'tcx,
Value = Self::Value,
Metadata = Self::Metadata,
Function = Self::Function,
BasicBlock = Self::BasicBlock,
Type = Self::Type,

View file

@ -24,14 +24,14 @@ pub trait IntrinsicCallBuilderMethods<'tcx>: BackendTypes {
fn assume(&mut self, val: Self::Value);
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;
fn type_test(&mut self, pointer: Self::Value, typeid: Self::Metadata) -> 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,
typeid: Self::Metadata,
) -> Self::Value;
/// Trait method used to inject `va_start` on the "spoofed" `VaListImpl` in
/// Rust defined C-variadic functions.

View file

@ -152,7 +152,7 @@ pub trait LayoutTypeCodegenMethods<'tcx>: BackendTypes {
pub trait TypeMembershipCodegenMethods<'tcx>: BackendTypes {
fn add_type_metadata(&self, _function: Self::Function, _typeid: String) {}
fn set_type_metadata(&self, _function: Self::Function, _typeid: String) {}
fn typeid_metadata(&self, _typeid: String) -> Option<Self::Value> {
fn typeid_metadata(&self, _typeid: String) -> Option<Self::Metadata> {
None
}
fn add_kcfi_type_metadata(&self, _function: Self::Function, _typeid: u32) {}