gallium/clover: pass -opaque-pointers to Clang on LLVM 15 and 16
authorThomas Debesse <dev@illwieckz.net>
Tue, 25 Oct 2022 05:18:16 +0000 (07:18 +0200)
committerThomas Debesse <dev@illwieckz.net>
Tue, 25 Oct 2022 05:18:16 +0000 (07:18 +0200)
commite74e82ea77c34b6134838bffb4085e0a5a77a4fe
tree747e9760142ced338b4c50b081110124f9f8a9c6
parent1a06dbcaed9ed4095ec8878d947935f0f7558cfd
gallium/clover: pass -opaque-pointers to Clang on LLVM 15 and 16

This does the exact opposite of 06e96074 from !16129.

Before LLVM commit 702d5de4 opaque pointers were supported but not enabled
by default when building LLVM. They were made default in commit 702d5de4.
LLVM commit d69e9f9d introduced -opaque-pointers/-no-opaque-pointers cc1
options to enable or disable them whatever the LLVM default is.

Those two commits follow llvmorg-15-init and precede llvmorg-15.0.0-rc1 tags.

Since LLVM commit d785a8ea, the CLANG_ENABLE_OPAQUE_POINTERS build option of
LLVM is removed, meaning there is no way to build LLVM with opaque pointers
enabled by default.
It was said at the time it was still possible to explicitly disable opaque
pointers via cc1 -no-opaque-pointers option, but it is known a later commit
broke backward compatibility provided by -no-opaque-pointers as verified with
arbitrary commit d7d586e5, so there is no way to use opaque pointers starting
with LLVM 16.

Those two commits follow llvmorg-16-init and precede llvmorg-16.0.0-rc1 tags.

Since Mesa commit 977dbfc9 opaque pointers are properly implemented in Clover
and used.

If we don't pass -opaque-pointers to Clang on LLVM versions supporting opaque
pointers but disabling them by default, there will be an API mismatch between
Mesa and LLVM and Clover will not work.

Signed-off-by: Thomas Debesse <dev@illwieckz.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19290>
src/gallium/frontends/clover/llvm/invocation.cpp