Mesa (main): ac: use LLVMContextSetOpaquePointers if available

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 8 09:06:30 UTC 2022


Module: Mesa
Branch: main
Commit: 940734630de229d98630e4398fd68e95c105177a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=940734630de229d98630e4398fd68e95c105177a

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Mon Jul  4 16:14:21 2022 +0200

ac: use LLVMContextSetOpaquePointers if available

Disabling opaque pointers in LLVM doesn't fix all the issues but
it makes pointers non-opaque by default (eg LLVMPointerType()
returns a typed pointer).

Reviewed-by: Mihai Preda <mhpreda at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17361>

---

 src/amd/llvm/ac_llvm_build.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/amd/llvm/ac_llvm_build.c b/src/amd/llvm/ac_llvm_build.c
index ecc2b63303b..9bb6e6a183b 100644
--- a/src/amd/llvm/ac_llvm_build.c
+++ b/src/amd/llvm/ac_llvm_build.c
@@ -62,6 +62,9 @@ void ac_llvm_context_init(struct ac_llvm_context *ctx, struct ac_llvm_compiler *
                           unsigned ballot_mask_bits)
 {
    ctx->context = LLVMContextCreate();
+   #if LLVM_VERSION_MAJOR >= 15
+   LLVMContextSetOpaquePointers(ctx->context, false);
+   #endif
 
    ctx->gfx_level = gfx_level;
    ctx->family = family;



More information about the mesa-commit mailing list