[PATCH] D134314: [HIP] stop forcing the lang std in the driver

Siu Chi Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 20 14:20:35 PDT 2022


scchan created this revision.
scchan added a reviewer: yaxunl.
Herald added a project: All.
scchan requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang.

D103221 <https://reviews.llvm.org/D103221> changed HIP's default to C++14, removing the driver logic to
force it into a different std.

Change-Id: I9f5220a7456687039b0bd3b3574f3124d3cc7665


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134314

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/hip-std.hip


Index: clang/test/Driver/hip-std.hip
===================================================================
--- clang/test/Driver/hip-std.hip
+++ clang/test/Driver/hip-std.hip
@@ -3,8 +3,10 @@
 
 // RUN: %clang -### --target=x86_64-unknown-linux-gnu -offload-arch=gfx906 %s \
 // RUN:   2>&1 | FileCheck -check-prefixes=DEFAULT %s
-// DEFAULT: "-cc1"{{.*}}"-fcuda-is-device"{{.*}}"-std=c++11"
-// DEFAULT: "-cc1"{{.*}}"-std=c++11"
+// DEFAULT: "-cc1"{{.*}}"-fcuda-is-device"{{.*}}
+// DEFAULT-NOT: "-std="{{.*}}
+// DEFAULT: "-cc1"{{.*}}
+// DEFAULT-NOT: "-std="{{.*}}
 
 // RUN: %clang -### --target=x86_64-unknown-linux-gnu -offload-arch=gfx906 %s \
 // RUN:   -std=c++17 %s 2>&1 | FileCheck -check-prefixes=SPECIFIED %s
@@ -13,8 +15,10 @@
 
 // RUN: %clang -### --target=x86_64-pc-windows-msvc -offload-arch=gfx906 %s \
 // RUN:   2>&1 | FileCheck -check-prefixes=MSVC-DEF %s
-// MSVC-DEF: "-cc1"{{.*}}"-fcuda-is-device"{{.*}}"-std=c++14"
-// MSVC-DEF: "-cc1"{{.*}}"-std=c++14"
+// MSVC-DEF: "-cc1"{{.*}}"-fcuda-is-device"{{.*}}
+// MSVC-DEF-NOT: "-std="{{.*}}
+// MSVC-DEF: "-cc1"{{.*}}
+// MSVC-DEF-NOT: "-std="{{.*}}
 
 // RUN: %clang -### --target=x86_64-pc-windows-msvc -offload-arch=gfx906 %s \
 // RUN:   -std=c++17 %s 2>&1 | FileCheck -check-prefixes=MSVC-SPEC %s
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5881,11 +5881,6 @@
 
     Args.AddLastArg(CmdArgs, options::OPT_ftrigraphs,
                     options::OPT_fno_trigraphs);
-
-    // HIP headers has minimum C++ standard requirements. Therefore set the
-    // default language standard.
-    if (IsHIP)
-      CmdArgs.push_back(IsWindowsMSVC ? "-std=c++14" : "-std=c++11");
   }
 
   // GCC's behavior for -Wwrite-strings is a bit strange:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134314.461703.patch
Type: text/x-patch
Size: 1866 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220920/faf26006/attachment-0001.bin>


More information about the cfe-commits mailing list