diff options
author | Sven van Haastregt <sven.vanhaastregt@arm.com> | 2018-05-08 13:47:43 +0000 |
---|---|---|
committer | Sven van Haastregt <sven.vanhaastregt@arm.com> | 2018-05-08 13:47:43 +0000 |
commit | 35b613974ec8b226ab19d1b058333005f25365fd (patch) | |
tree | 4b20256bc539de5cba87e1a4fe4de4f19bfd1b0e /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 4283924e089f091819086dc06aea9d9060133ade (diff) | |
download | bcm5719-llvm-35b613974ec8b226ab19d1b058333005f25365fd.tar.gz bcm5719-llvm-35b613974ec8b226ab19d1b058333005f25365fd.zip |
[OpenCL] Factor out language version printing
Generate a printable OpenCL language version number in a single place
and select between the OpenCL C or OpenCL C++ version accordingly.
Differential Revision: https://reviews.llvm.org/D46382
llvm-svn: 331766
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index cb107068182..0156e75628c 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -76,7 +76,6 @@ #include "llvm/Support/Path.h" #include "llvm/Support/Process.h" #include "llvm/Support/Regex.h" -#include "llvm/Support/ScopedPrinter.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetOptions.h" #include <algorithm> @@ -2157,11 +2156,9 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, // this option was added for compatibility with OpenCL 1.0. if (Args.getLastArg(OPT_cl_strict_aliasing) && Opts.OpenCLVersion > 100) { - std::string VerSpec = llvm::to_string(Opts.OpenCLVersion / 100) + - std::string(".") + - llvm::to_string((Opts.OpenCLVersion % 100) / 10); Diags.Report(diag::warn_option_invalid_ocl_version) - << VerSpec << Args.getLastArg(OPT_cl_strict_aliasing)->getAsString(Args); + << Opts.getOpenCLVersionTuple().getAsString() + << Args.getLastArg(OPT_cl_strict_aliasing)->getAsString(Args); } // We abuse '-f[no-]gnu-keywords' to force overriding all GNU-extension |