gallivm: LLVM-15 opaque pointers fixes
LLVM-15 enables opaque pointers while still supporting legacy typed pointers; but we need to migrate our code to opaque pointers before LLVM-16 arrives.
The changes are mainly along these lines:
- use LLVMBuildGEP2 and LLVMBuildLoad2 instead of the deprecated LLVMBuildGEP, LLVMBuildLoad. For this we need to know the deref-type of the pointer.
- don't query the "element type" of a pointer type.
Edited by Mihai Preda