[PATCH] D108379: [OpenCL] Fix version reporting of C++ for OpenCL 2021

Justas Janickas via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 20 00:58:55 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG9ae9262857a1: [OpenCL] Fix version reporting of C++ for OpenCL 2021 (authored by Topotuna).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108379/new/

https://reviews.llvm.org/D108379

Files:
  clang/lib/Basic/LangOptions.cpp


Index: clang/lib/Basic/LangOptions.cpp
===================================================================
--- clang/lib/Basic/LangOptions.cpp
+++ clang/lib/Basic/LangOptions.cpp
@@ -47,6 +47,8 @@
 
 VersionTuple LangOptions::getOpenCLVersionTuple() const {
   const int Ver = OpenCLCPlusPlus ? OpenCLCPlusPlusVersion : OpenCLVersion;
+  if (OpenCLCPlusPlus && Ver != 100)
+    return VersionTuple(Ver / 100);
   return VersionTuple(Ver / 100, (Ver % 100) / 10);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108379.367729.patch
Type: text/x-patch
Size: 468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210820/2eced1c8/attachment.bin>


More information about the cfe-commits mailing list