clc: undefine spirv defs to work around LLVMs headers
authorKarol Herbst <kherbst@redhat.com>
Thu, 12 May 2022 21:57:24 +0000 (23:57 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 4 Aug 2022 23:53:50 +0000 (23:53 +0000)
commit6637b1f41e6a67b8f7a97c8253895c0a3fbc7ddb
treed581a1817a61c0f7b99584d86e53c225c8c300e1
parent6b38114ed7cf20bc38d487d19c635c3d3539ba46
clc: undefine spirv defs to work around LLVMs headers

Clang unconditionally adds those definitions if using a spirv LLVM target.

That's not a problem on its own, but clang's internal OpenCL header enable
a bunch of OpenCL extensions if those are set.

Lucky for us, we can simply undefine them and spare us the trouble of
finding an upstream solution to this problem :)

This fixes the OpenCL CTS' compiler features_macro test.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17334>
src/compiler/clc/clc_helpers.cpp