Prepare gep for opaque pointers

Implement gep using LLVMBuildGEP2 which takes an explicit type argument
instead of deriving it from a pointer type.
This commit is contained in:
Tomasz Miąsko
2021-07-31 00:00:00 +00:00
parent 838042aa4e
commit 4013e094f5
6 changed files with 13 additions and 9 deletions

View File

@@ -176,7 +176,7 @@ pub trait BuilderMethods<'a, 'tcx>:
size: Size,
);
fn gep(&mut self, ptr: Self::Value, indices: &[Self::Value]) -> Self::Value;
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 struct_gep(&mut self, ty: Self::Type, ptr: Self::Value, idx: u64) -> Self::Value;