diff options
author | Alexey Bader <aleksey.bader@mail.ru> | 2016-11-01 15:50:52 +0000 |
---|---|---|
committer | Alexey Bader <aleksey.bader@mail.ru> | 2016-11-01 15:50:52 +0000 |
commit | 0ea075328ebb0368cf208ca11e3b2123179a259b (patch) | |
tree | b1f910a3a48d519e3c8aebd4b9e332e9a5687431 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 04ef115ff7e352de52b6f8fff2d3f019d20332ca (diff) | |
download | bcm5719-llvm-0ea075328ebb0368cf208ca11e3b2123179a259b.tar.gz bcm5719-llvm-0ea075328ebb0368cf208ca11e3b2123179a259b.zip |
[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
llvm-svn: 285700
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index c4fa01c8173..ff22ed8e072 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -2385,6 +2385,7 @@ static void ParseTargetArgs(TargetOptions &Opts, ArgList &Args, // Use the default target triple if unspecified. if (Opts.Triple.empty()) Opts.Triple = llvm::sys::getDefaultTargetTriple(); + Opts.OpenCLExtensionsAsWritten = Args.getAllArgValues(OPT_cl_ext_EQ); } bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res, |