]> granicus.if.org Git - clang/commit
[OpenCL] Override supported OpenCL extensions with -cl-ext option
authorAlexey Bader <aleksey.bader@mail.ru>
Tue, 1 Nov 2016 15:50:52 +0000 (15:50 +0000)
committerAlexey Bader <aleksey.bader@mail.ru>
Tue, 1 Nov 2016 15:50:52 +0000 (15:50 +0000)
commit63cbcdadcc74a3a6e0ff9f76028758ce97741203
treed554412ac39a4551ca9cd3b2b8260d1dc2f97389
parent1cd2ec853d7d1b67c182989921a27fc875e36ffb
[OpenCL] Override supported OpenCL extensions with -cl-ext option

Summary:
This patch adds a command line option '-cl-ext' to control a set of
supported OpenCL extensions. Option accepts a comma-separated list
of extensions prefixed with '+' or '-'.

It can be used together with a target triple to override support for some
extensions:

  // spir target supports all extensions, but we want to disable fp64
  clang -cc1 -triple spir-unknown-unknown -cl-ext=-cl_khr_fp64

Special 'all' extension allows to enable or disable all possible
extensions:

  // only fp64 will be supported
  clang -cc1 -triple spir-unknown-unknown -cl-ext=-all,+cl_khr_fp64

Patch by asavonic (Andrew Savonichev).

Reviewers: joey, yaxunl

Subscribers: yaxunl, bader, Anastasia, cfe-commits

Differential Revision: https://reviews.llvm.org/D23712

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285700 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/OpenCLOptions.h
include/clang/Basic/TargetInfo.h
include/clang/Basic/TargetOptions.h
include/clang/Driver/CC1Options.td
lib/Basic/Targets.cpp
lib/Frontend/CompilerInvocation.cpp
test/SemaOpenCL/extensions.cl