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:
parent
838042aa4e
commit
4013e094f5
6 changed files with 13 additions and 9 deletions
|
@ -640,10 +640,11 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
fn gep(&mut self, ptr: &'ll Value, indices: &[&'ll Value]) -> &'ll Value {
|
||||
fn gep(&mut self, ty: &'ll Type, ptr: &'ll Value, indices: &[&'ll Value]) -> &'ll Value {
|
||||
unsafe {
|
||||
llvm::LLVMBuildGEP(
|
||||
llvm::LLVMBuildGEP2(
|
||||
self.llbuilder,
|
||||
ty,
|
||||
ptr,
|
||||
indices.as_ptr(),
|
||||
indices.len() as c_uint,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue