diff options
author | Justas Janickas <Justas.Janickas@arm.com> | 2021-08-06 13:50:13 +0100 |
---|---|---|
committer | Justas Janickas <Justas.Janickas@arm.com> | 2021-08-13 13:55:22 +0100 |
commit | cfdfb75c1ff354471bcea5fad872e40e345016ae (patch) | |
tree | 68d21b3c67de54f1cef328df067036155cf330b5 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | c46546bd521b7c3f98a1620c9227e80dc94a5a3c (diff) | |
download | llvm-cfdfb75c1ff354471bcea5fad872e40e345016ae.zip llvm-cfdfb75c1ff354471bcea5fad872e40e345016ae.tar.gz llvm-cfdfb75c1ff354471bcea5fad872e40e345016ae.tar.bz2 |
[OpenCL] Clang diagnostics allow reporting C++ for OpenCL version.
Some Clang diagnostics could only report OpenCL C version. Because
C++ for OpenCL can be used as an alternative to OpenCL C, the text
for diagnostics should reflect that.
Desrciptions modified for these diagnostics:
`err_opencl_unknown_type_specifier`
`warn_option_invalid_ocl_version`
`err_attribute_requires_opencl_version`
`warn_opencl_attr_deprecated_ignored`
`ext_opencl_ext_vector_type_rgba_selector`
Differential Revision: https://reviews.llvm.org/D107648
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 692e685..83dc6ec 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -503,9 +503,10 @@ static bool FixupInvocation(CompilerInvocation &Invocation, // -cl-strict-aliasing needs to emit diagnostic in the case where CL > 1.0. // This option should be deprecated for CL > 1.0 because // this option was added for compatibility with OpenCL 1.0. - if (Args.getLastArg(OPT_cl_strict_aliasing) && LangOpts.OpenCLVersion > 100) + if (Args.getLastArg(OPT_cl_strict_aliasing) && + (LangOpts.OpenCLCPlusPlus || LangOpts.OpenCLVersion > 100)) Diags.Report(diag::warn_option_invalid_ocl_version) - << LangOpts.getOpenCLVersionTuple().getAsString() + << LangOpts.getOpenCLVersionString() << Args.getLastArg(OPT_cl_strict_aliasing)->getAsString(Args); if (Arg *A = Args.getLastArg(OPT_fdefault_calling_conv_EQ)) { |