[all-commits] [llvm/llvm-project] a60b8f: [OpenCL] Allow undefining header-only features
Sven van Haastregt via All-commits
all-commits at lists.llvm.org
Mon Jan 16 03:32:47 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a60b8f468119065f8a6cb4a16598263cb00de0b5
https://github.com/llvm/llvm-project/commit/a60b8f468119065f8a6cb4a16598263cb00de0b5
Author: Sven van Haastregt <sven.vanhaastregt at arm.com>
Date: 2023-01-16 (Mon, 16 Jan 2023)
Changed paths:
M clang/lib/Headers/opencl-c-base.h
M clang/test/SemaOpenCL/features.cl
Log Message:
-----------
[OpenCL] Allow undefining header-only features
`opencl-c-base.h` always defines 5 particular feature macros for
SPIR-V, making it impossible to disable those features.
To allow disabling any of those features, let the header recognize
`__undef_<feature>` macros. The user can then pass the
`-D__undef_<feature>` flag on the command line to disable a specific
feature. The __undef macro could potentially also be set from
`-cl-ext=-feature`, but for now only change the header and only
provide __undef macros for the 5 features that are always enabled in
`opencl-c-base.h`.
Differential Revision: https://reviews.llvm.org/D141297
More information about the All-commits
mailing list