summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorSven van Haastregt <sven.vanhaastregt@arm.com>2018-05-09 13:16:17 +0000
committerSven van Haastregt <sven.vanhaastregt@arm.com>2018-05-09 13:16:17 +0000
commit2ca6ba1045c9fbc3629034fbf2da11055c1e35ff (patch)
tree484830944f2b09546677121bf8e6cd7d9f7f555c /clang/lib/Frontend/CompilerInvocation.cpp
parentf384bc716638d94406658be70c3ece82670905c9 (diff)
downloadbcm5719-llvm-2ca6ba1045c9fbc3629034fbf2da11055c1e35ff.tar.gz
bcm5719-llvm-2ca6ba1045c9fbc3629034fbf2da11055c1e35ff.zip
[OpenCL] Restrict various keywords in OpenCL C++ mode
Restrict the following keywords in the OpenCL C++ language mode, according to Sections 2.2 & 2.9 of the OpenCL C++ 1.0 Specification. - dynamic_cast - typeid - register (already restricted in OpenCL C, update the diagnostic) - thread_local - exceptions (try/catch/throw) - access qualifiers read_only, write_only, read_write Support the `__global`, `__local`, `__constant`, `__private`, and `__generic` keywords in OpenCL C++. Leave the unprefixed address space qualifiers such as global available, i.e., do not mark them as reserved keywords in OpenCL C++. libclcxx provides explicit address space pointer classes such as `global_ptr` and `global<T>` that are implemented using the `__`-prefixed qualifiers. Differential Revision: https://reviews.llvm.org/D46022 llvm-svn: 331874
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 20874fcf530..71c946442d7 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2596,7 +2596,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
// Set the flag to prevent the implementation from emitting device exception
// handling code for those requiring so.
Opts.OpenMPHostCXXExceptions = Opts.Exceptions && Opts.CXXExceptions;
- if (Opts.OpenMPIsDevice && T.isNVPTX()) {
+ if ((Opts.OpenMPIsDevice && T.isNVPTX()) || Opts.OpenCLCPlusPlus) {
Opts.Exceptions = 0;
Opts.CXXExceptions = 0;
}
OpenPOWER on IntegriCloud