Prepare inbounds_gep for opaque pointers

Implement inbounds_gep using LLVMBuildInBoundsGEP2 which takes an
explicit type argument instead of deriving it from a pointer type.
This commit is contained in:
Tomasz Miąsko
2021-08-01 00:00:00 +00:00
parent 4013e094f5
commit 77e5e17231
11 changed files with 61 additions and 22 deletions

View File

@@ -177,7 +177,12 @@ pub trait BuilderMethods<'a, 'tcx>:
);
fn gep(&mut self, ty: Self::Type, ptr: Self::Value, indices: &[Self::Value]) -> Self::Value;
fn inbounds_gep(&mut self, ptr: Self::Value, indices: &[Self::Value]) -> Self::Value;
fn inbounds_gep(
&mut self,
ty: Self::Type,
ptr: Self::Value,
indices: &[Self::Value],
) -> Self::Value;
fn struct_gep(&mut self, ty: Self::Type, ptr: Self::Value, idx: u64) -> Self::Value;
fn trunc(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value;